GWicke has submitted this change and it was merged. Change subject: Set tsr on nl-toks and use it to compute tsr for indent-pre toks. ......................................................................
Set tsr on nl-toks and use it to compute tsr for indent-pre toks. * Multi-line pres sometimes lose tsr info. about leading space that triggered the indent-pre. " a\n b\n c" parses to <pre>a\nb\nc</pre> without the leading spaces which means dsr computation loses 1 char for each line (unless it is reset by the presence of a regular token on the first line). * To fix this, this patch assigns a tsr value to the indent-pre token by computing this in the pre-handler on the basis of tsr value assigned to the preceding line's newline-token and doing some book-keeping across SOL-transparent tokens on the indent-pre line. To enable this, added a tsr property to NlTk objects and initialized them in the tokenizer. * No change in parser tests, but fixes DSR computation of the example above. Change-Id: I85490e5c2fc13be203259b052d67a81ee5b38c78 --- M js/lib/ext.core.PreHandler.js M js/lib/mediawiki.parser.defines.js M js/lib/pegTokenizer.pegjs.txt 3 files changed, 42 insertions(+), 6 deletions(-) Approvals: GWicke: Verified; Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/36315 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I85490e5c2fc13be203259b052d67a81ee5b38c78 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: Subramanya Sastry <[email protected]> Gerrit-Reviewer: GWicke <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
