Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
InTextAnnotationParser to check for possible pipe split, refs 1747
This PR changes the behaviour of `InTextAnnotationParser` in order to recognize that `[[Foo|Bar::Foobar]]` is a non-value annotation even though it contains a `::` marker.
- Loading branch information
Showing
3 changed files
with
126 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
tests/phpunit/Integration/ByJsonScript/Fixtures/p-0433.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"description": "Test in-text annotation `::` with left pipe (#1747, `wgContLang=en`)", | ||
"properties": [ | ||
{ | ||
"name": "Has text", | ||
"contents": "[[Has type::Text]]" | ||
} | ||
], | ||
"subjects": [ | ||
{ | ||
"name": "Example/P0433/1", | ||
"contents": "[[Foo|Bar::Foobar]] [[File:Example.png|alt=Bar::Foobar|Caption]] [[File:Example.png|Bar::Foobar|link=Foo]]" | ||
}, | ||
{ | ||
"name": "Example/P0433/2", | ||
"contents": "{{#set:Has text=[[Foo|Bar::Foobar]] [[File:Example.png|alt=Bar::Foobar|Caption]] [[File:Example.png|Bar::Foobar|link=Foo]] }}" | ||
}, | ||
{ | ||
"name": "Example/P0433/Q.1", | ||
"contents": "{{#ask: [[Example/P0433/2]] |?Has text |link=none}}" | ||
} | ||
], | ||
"parser-testcases": [ | ||
{ | ||
"about": "#0 no annotation due to left pipe", | ||
"subject": "Example/P0433/1", | ||
"store": { | ||
"semantic-data": { | ||
"strict-mode-valuematch": false, | ||
"propertyCount": 3, | ||
"propertyKeys": [ "_SKEY", "_MDAT", "_INST" ], | ||
"propertyValues": [] | ||
} | ||
} | ||
}, | ||
{ | ||
"about": "#1", | ||
"subject": "Example/P0433/2", | ||
"store": { | ||
"semantic-data": { | ||
"strict-mode-valuematch": false, | ||
"propertyCount": 3, | ||
"propertyKeys": [ "_SKEY", "_MDAT", "Has_text" ], | ||
"propertyValues": [ "[[Foo|Bar::Foobar]] [[File:Example.png|alt=Bar::Foobar|Caption]] [[File:Example.png|Bar::Foobar|link=Foo]]" ] | ||
} | ||
} | ||
}, | ||
{ | ||
"about": "#2", | ||
"subject": "Example/P0433/Q.1", | ||
"expected-output": { | ||
"to-contain": [ | ||
"title=\"File:Example.png\">Caption</a>", | ||
"title=\"File:Example.png\">Bar::Foobar</a>" | ||
] | ||
} | ||
} | ||
], | ||
"settings": { | ||
"wgContLang": "en", | ||
"smwgPageSpecialProperties": [ "_MDAT" ] | ||
}, | ||
"meta": { | ||
"version": "0.1", | ||
"is-incomplete": false, | ||
"debug": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters