« Escape accolade » : différence entre les versions

De Semantic MediaWiki - Sandbox

Aucun résumé des modifications
Aucun résumé des modifications
 
(4 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
Curly braces can't be used in parser functions like 'set' (or 'var'). Escaping them gives issues in different result formats.
Curly braces can't be used in parser functions like 'set' (or 'var'). Escaping them gives issues in different result formats.


* Accolade {{#set:Description_nl=Accolade-left: {}}
In most cases, the 'nowiki'-tag is shown, wrapped around the full value (while it is only used at the end). Expected behaviour: the nowiki-tag is not shown.
* HTML character entity reference - {{#set:Description_nl=HTML entity reference: {}}
In
* nowiki - {{#set:Description_nl=nowiki: <nowiki>{</nowiki> }}
 
* [[Template:Accolade left|template]] with nowiki in it- {{#set:Description_nl=Template with nowiki: {{Accolade left}} }}
 
* [[Description_nl::semantic link: {]]
* Accolade {{#set:Has text=Accolade-left: {end}}
* HTML character entity reference - {{#set:Has text=HTML entity reference: &#123;end}}
* nowiki - {{#set:Has text=nowiki: <nowiki>{</nowiki> end}}
* [[Template:Accolade left|template]] curly bracket in it - {{#set:Has text=Template with nowiki: {{Accolade left}} end}}
* [[Has text::semantic link: { end]]
{{DISPLAYTITLE:escaped &#123; }}
{{DISPLAYTITLE:escaped &#123; }}
==default-result (broadtable)==
==default-result (broadtable)==
{{#ask: [[Escape accolade]]
{{#ask: [[Escape accolade]]
  |?Description nl
  |?Has text
  |propsep=;  
  |propsep=;  
  |valuesep=<br />
  |valuesep=<br />
}}
}}
==ul==
==ul==
{{#ask: [[Escape accolade]]
{{#ask: [[Escape accolade]]
  |?Description nl
  |?Has text
  |format=ul
  |format=ul
  |limit=250
  |limit=250
  |propsep=;  
  |propsep=;  
  |valuesep=<br />  
  |valuesep=<br />  
}}
Verify it's not the valuesep=br, by ommitting it:
{{#ask: [[Escape accolade]]
|?Has text
|format=ul
|limit=250
|propsep=;
}}
}}
==ol==
==ol==
{{#ask: [[Escape accolade]]
{{#ask: [[Escape accolade]]
  |?Description nl
  |?Has text
  |format=ol
  |format=ol
  |limit=250
  |limit=250
Ligne 31 : Ligne 45 :
==plainlist==
==plainlist==
{{#ask: [[Escape accolade]]
{{#ask: [[Escape accolade]]
  |?Description nl
  |?Has text
  |format=plainlist
  |format=plainlist
  |limit=250
  |limit=250
Ligne 39 : Ligne 53 :
==list==
==list==
{{#ask: [[Escape accolade]]
{{#ask: [[Escape accolade]]
  |?Description nl
  |?Has text
  |format=list
  |format=list
  |limit=250
  |limit=250
Ligne 46 : Ligne 60 :
}}
}}
==csv==
==csv==
In CSV the displaytitle is not taken into account; the value for page name is the full page name.
{{#ask: [[Escape accolade]]
{{#ask: [[Escape accolade]]
  |?Description nl
  |?Has text
  |format=csv
  |format=csv
  |limit=250
  |limit=250
  |propsep=;  
  |propsep=;  
  |filename=
  |filename=curly-bracket
}}
}}
==rdf==
==rdf==
In RDF-XML and RDF Turtle the displaytitle is ignored. The html character entity code is not decoded. The 'nowiki' tag is preserved.
{{#ask: [[Escape accolade]]
{{#ask: [[Escape accolade]]
  |?Description nl
  |?Has text
  |format=rdf
  |format=rdf
  |limit=250
  |limit=250
  |propsep=;  
  |propsep=;
|filename=curly-bracket
|searchlabel=RDF-XML
}}
{{#ask: [[Escape accolade]]
|?Has text
|format=rdf
|limit=250
|propsep=;
|filename=curly-bracket
|syntax=turtle
|searchlabel=RDF Turtle (TTL)
}}
}}
==json==
==json==
In JSON, the html entity character entity is not parsed and nowiki is shown *and* used. Also in the value for 'displaytitle'.
{{#ask: [[Escape accolade]]
{{#ask: [[Escape accolade]]
  |?Description nl
  |?Has text
  |format=json
  |format=json
  |limit=250
  |limit=250
  |propsep=;  
  |propsep=;  
|filename=curly-bracket
}}
}}

Dernière version du 20 septembre 2023 à 12:36

Curly braces can't be used in parser functions like 'set' (or 'var'). Escaping them gives issues in different result formats.

In most cases, the 'nowiki'-tag is shown, wrapped around the full value (while it is only used at the end). Expected behaviour: the nowiki-tag is not shown. In


  • Accolade
  • HTML character entity reference -
  • nowiki -
  • template curly bracket in it -
  • semantic link: { end

default-result (broadtable)

 Has text
escaped {Accolade-left: {end
HTML entity reference: {end
<nowiki>nowiki: { end</nowiki>
Template with nowiki: { end
semantic link: { end

ul

  • escaped { (Has text: Accolade-left: {end
    HTML entity reference: {end
    <nowiki>nowiki: { end</nowiki>
    Template with nowiki: { end
    semantic link: { end
    )

Verify it's not the valuesep=br, by ommitting it:

  • escaped { (Has text: Accolade-left: {end, HTML entity reference: {end, <nowiki>nowiki: { end</nowiki>, Template with nowiki: { end, semantic link: { end)

ol

  1. escaped { (Has text: Accolade-left: {end
    HTML entity reference: {end
    <nowiki>nowiki: { end</nowiki>
    Template with nowiki: { end
    semantic link: { end
    )

plainlist

escaped { (Has text: Accolade-left: {end
HTML entity reference: {end
<nowiki>nowiki: { end</nowiki>
Template with nowiki: { end
semantic link: { end)

list

escaped { (Has text: Accolade-left: {end
HTML entity reference: {end
<nowiki>nowiki: { end</nowiki>
Template with nowiki: { end
semantic link: { end)

csv

In CSV the displaytitle is not taken into account; the value for page name is the full page name.

CSV

rdf

In RDF-XML and RDF Turtle the displaytitle is ignored. The html character entity code is not decoded. The 'nowiki' tag is preserved.

RDF-XML RDF Turtle (TTL)

json

In JSON, the html entity character entity is not parsed and nowiki is shown *and* used. Also in the value for 'displaytitle'.

JSON

Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.