Page MenuHomePhabricator

Unnecessary nowiki in an indent-pre block
Closed, ResolvedPublic

Description

[subbu@earth lib] echo " * foo\n * bar" | node parse --wt2wt
 * foo
 <nowiki>*</nowiki> bar

From: http://parsoid-tests.wikimedia.org/result/8f35374d10b32abc4dc37aabcea119ef44208078/enwiki/Franz_Josef_Kallmann

Event Timeline

ssastry created this task.Apr 11 2015, 2:22 AM
ssastry raised the priority of this task from to Medium.
ssastry updated the task description. (Show Details)
ssastry added projects: Parsoid, Parsoid-Nowiki.
ssastry added a subscriber: ssastry.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 11 2015, 2:22 AM

After a little investigation: in wts.escapeWikitext.js, WEHP.hasWikitextTokens calls the tokenizer with the right SOL state, but the second line is tokenized to a listItem TagTk, which provokes it being surrounded with <nowiki>s. Maybe there should be a way for the tokenizer to act differently if the whole text is in pre?

It just needs to replace "\n" with "\n " and tokenize it.

marcoil claimed this task.Apr 20 2015, 10:04 AM

It just needs to replace "\n" with "\n " and tokenize it.

I'll try that.

Change 205254 had a related patch set uploaded (by Marcoil):
T95794: Enforce <pre> for all lines when escaping wikitext

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

Change 205254 merged by jenkins-bot:
T95794: Enforce <pre> for all lines when escaping wikitext

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