If I input <nowiki>a</nowiki> in VE, save the page, then go back to the editor, text is broken in VE there.
Version: unspecified
Severity: normal
If I input <nowiki>a</nowiki> in VE, save the page, then go back to the editor, text is broken in VE there.
Version: unspecified
Severity: normal
Input HTML: <nowiki>a</nowiki>
Actual output wikitext after RT: <nowiki><nowiki></nowiki>a<nowiki></nowiki></nowiki>
Expected wikitext: ???
Cannot replicate this either at http://parsoid.wmflabs.org/_html/ or on my CLI (excess newlines trimmed below) with the current HEAD.
[subbu@earth lib] echo "<nowiki>a</nowiki>" | node parse.js --html2wt
<nowiki>a</nowiki>
[subbu@earth lib] echo "<nowiki>a</nowiki>" | node parse.js --html2wt | node parse.js
<p><span typeof="mw:Nowiki" data-parsoid="{"tsr":[0,8],"bsp":[0,18]}">a</span></p>
[subbu@earth lib] echo "<nowiki>a</nowiki>" | node parse.js --html2wt | node parse.js | node parse.js --html2wt
<nowiki>a</nowiki>
Either VE is using an older Parsoid version -- or something else is broken.
Oh, never mind. I got it wrong. So, the input is not what I tested against. The text to test is "<nowiki>a</nowiki>
<nowiki> is invalid HTML. The DOM representation of nowiki is <span typeof="mw:Nowiki">, which round-trips ok. Not sure if the VE handles this properly right now.
<nowiki> in a DOM text node (<nowiki> when entered in the HTML -> wikitext test form) properly serializes to <nowiki>.
Please test round-trip stuff on http://parsoid.wmflabs.org/ if possible ;)
Hmm- seems as if I made a mistake while testing this. There might be a Parsoid bug after all.
So to be entirely clear:
$ echo "<nowiki>a</nowiki>" | node parse.js --html2wt
actual
<nowiki><nowiki></nowiki>a<nowiki></nowiki></nowiki>
expected
The problem is pretty clearly in mw.WikitextSerializer.js, near line 152, in the function wrapNonTextTokens. The serializer escapes any instances of <\/?nowiki> with its HTML-entitied counterpart, then wraps it in <nowiki>. I don't know why right now.
git blame seems to think Gabriel would know :)
[Parsoid component reorg by merging CPP/* tickets into General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]