Escape > in structure field

Hello,

how escape md formatting syntax ?
in a normal kirbytext it is no problem.

Last \>20 kg: jedes weitere kg

greetings perry

If it works in normal fields but not in structure fields, it’s probably an issue with the YAML library Spyc. There was a similar issue with quotes.

Could you please try:

Last \\>20 kg: jedes weitere kg

No, dosen’t work.

output:

Last >20 kg: jedes weitere kg

raw html:

<tr><td>Last &amp;gt;20 kg: jedes weitere kg</td>
<td>1.-</td>
</tr>

I will do some tests with this in the next few days.

I just tested this with a structure field and it worked just fine. Could you please post:

  • your blueprint,
  • the exact value you entered in the structure field,
  • the exact value that was saved in the content file and
  • if you use Markdown Extra?

Thank you in advance.

hello lukasbestle,

blueprint

title: Preise
pages: true
files: true
fields:
  title:
    label: Title
    type:  text
  title_on_page:
    label: Titel auf Webseite
    type:  text
  richtext:
    label: Text
    type:  markdown
    header1: h2
    header2: h3

  table01:
    label: tabele01
    type: structure
    style: table
    modalsize: small
    entry: >
      
      {{spalte01}} {{spalte02}}
    fields:
      spalte01:
        label: Spalte01
        type: text
      spalte02:
        label: Spalte02
        type: text

  table02:
    label: tabele02
    type: structure
    style: table
    modalsize: small
    entry: >
      
      {{spalte01}} {{spalte02}}
    fields:
      spalte01:
        label: Spalte01
        type: text
      spalte02:
        label: Spalte02
        type: text

  table03:
    label: tabele03
    type: structure
    style: table
    modalsize: small
    entry: >
      
      {{spalte01}} {{spalte02}}
    fields:
      spalte01:
        label: Spalte01
        type: text
      spalte02:
        label: Spalte02
        type: text

  home_preis:
    label: Preis Kachel
    type:  text

  home_field_text:
    label: Text Kachel
    type:  text


  home_image_url:
        label: Grafik Kachel
        type: image

  tags:
    label: Tags
    type: tags
  sidebar_images:
        label: Sidebar
        type:  selector
        mode:  multiple
        types:
            - image

files:
  sortable: true
  fields:
    caption:
      label: Caption
      type: text

the value input

Last \>20 kg: jedes weitere kg

the saved value

 spalte01: 'Last \>20 kg: jedes weitere kg'

Markdown Extra: Yes

tag to embed the structur field as table

<?php

kirbytext::$tags['table'] = array(
 'html' => function($tag) {
    $html = '<table>';
    
    $field = $tag->attr('table');
    foreach($tag->page()->$field()->toStructure() as $table) {
      $html .= '<tr>';
      $html .= '<td>';
      $html .= $table->spalte01()->html();
      $html .= '</td>';
      $html .= '<td>';
      $html .= $table->spalte02()->html();
      $html .= '</td>';
      $html .= '</tr>';
    }

    $html .= '</table>';

    return $html;
  }
);

?>

@lukasbestle

s o r r y

I found out why it is not working :

template

working

<?php echo $page->richtext()->kirbytext() ?>

not working ( doppelt gemoppelt)

<?php echo $page->richtext()->kirbytext()->html() ?>

1 Like

Thanks for letting me know. I would have searched for hours. :wink: