Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
3173 Weergaven

Hi everyone

I have a website page with a <code></code> block inside. Inside this code block is some code that has < and > symbols:

#include <Wire.h>

I can't write it like this because then Odoo complains that there is a XMLSyntaxError: Opening and ending tag mismatch when I try to update my module.

I also tried writing it like:

#include &lt;Wire.h&gt;

But then odoo renders the <Wire.h> as HTML code and creates a <Wire.h></Wire.h> block inside my <code></code> block...

Does anyone know any solution for this?   

Avatar
Annuleer
Beste antwoord

A (not beautiful) solution is to use a variable, and then t-esc this one.

<t t-set='mytext' t-value='#include &lt;Wire.h&gt;</t>'/>
<t t-esc='mytext' />
Avatar
Annuleer
Beste antwoord

you can use cdata symtax in xml file, for example:

<field name='text_field><![CDATA[
Within this Character Data block I can
use double dashes as much as I want (along with <, &, ', and ")
*and* %MyParamEntity; will be expanded to the text
"Has been expanded" ... however, I can't use
the CEND sequence. If I need to use CEND I must escape one of the
brackets or the greater-than sign using concatenated CDATA sections.
]]>
</field>

on website template you can use "t-raw" or "t-ecs" for render this value:
https://www.odoo.com/vi_VN/forum/help-1/question/what-is-the-difference-between-t-esc-and-t-raw-92184



  




Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 23
13613
0
dec. 24
51
1
feb. 24
873
0
dec. 23
1002
0
aug. 22
2568