Page MenuHomePhabricator

Magic word strings aren't nowikid if the relevant DOM node is not in a start-of-line context
Closed, ResolvedPublic

Description

Right now they're not, which is irritating when I'm writing about how VE supports the functionality. :-)


Version: unspecified
Severity: normal

Details

Reference
bz66514

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:21 AM
bzimport set Reference to bz66514.

See https://en.wikipedia.org/w/index.php?title=User%3ASsastry%2FVE_Test&diff=613314757&oldid=584723202

and also this:

[subbu@earth lib] echo "This is a test of DISAMBIG getting nowikied" | node parse --html2wt
This is a test of <nowiki>DISAMBIG</nowiki> getting nowikied

See e.g. https://www.mediawiki.org/w/index.php?title=VisualEditor/status&diff=prev&oldid=1034135 for an insertion without <nowiki>s, or https://www.mediawiki.org/w/index.php?title=VisualEditor:Bug_66514&oldid=1039124 for a more minimal test.

The problem appears to be that <code>Foo</code> stops Foo being recognised.

[subbu@earth lib] echo "<b>TOC</b>" | node parse --html2wt
'''TOC'''
[subbu@earth lib] echo "<foobar>DISAMBIG</foobar>" | node parse --html2wt
<foobar>DISAMBIG</foobar>

[subbu@earth lib] echo "Fails when not in <b>sol context</b> TOC" | node parse --html2wt --trace wt-escape
[wt-esc] | EWT: "Fails when not in "
[wt-esc] | ---No-checks needed---
[wt-esc] | EWT: "sol context"
[wt-esc] | ---No-checks needed---
[wt-esc] | EWT: " TOC"
[wt-esc] | SOL: false " TOC"
[wt-esc] | ---Not-SOL and safe---
Fails when not in '''sol context''' TOC
[subbu@earth lib] echo "Works when node is in sol context TOC" | node parse --html2wt --trace wt-escape
[wt-esc] | EWT: "Works when node is in sol context TOC"
[wt-esc] | SOL: true "Works when node is in sol context TOC"
[wt-esc] | nl: true :text= "Works when node is in sol context TOC"
[wt-esc] | T: "Works when node is in sol context "
[wt-esc] | T: {"type":"SelfclosingTagTk","name":"behavior-switch","attribs":[{"k":"word","v":"TOC"}],"dataAttribs":{"tsr":[34,41],"src":"TOC"}}
[wt-esc] | ---Found WT tokens---
Works when node is in sol context <nowiki>TOC</nowiki>

Change 140194 had a related patch set uploaded by Subramanya Sastry:
(Bug 66514) Fix bug in nowiki-escaping of magic words

https://gerrit.wikimedia.org/r/140194

Change 140194 merged by jenkins-bot:
(Bug 66514) Fix bug in nowiki-escaping of magic words

https://gerrit.wikimedia.org/r/140194