mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
08b5ed1a43
This makes sure that we escape start-of-line syntax when needed, since onNewline is often not yet set. Discussion / background: [19:18] <subbu> this will fix it, but, i think this is asking for another minor refactoring of these flags ... because this is a subtle fix which means it might be possible to make it clearer. onNewline is one true in on direction, i.e. if true, we are in a new line state, but if we are in a newline context, onNewline is not true, which is why this new method is needed. [19:19] <subbu> i dont know if it is possible, but it seems like it shoudl be possible. but, something for later. [19:20] <subbu> badly phraed. "onNewline" ==> in new line context, but if in new line context, onNewline may be false. [19:20] <gwicke> we should perhaps update it as early as possible instead [19:21] <subbu> i cannot today, but possible monday. i am heading out in about 15-30 mins. [19:22] <gwicke> will need to check all conditions depending on it in _serializeToken [19:22] <subbu> oh, i misunderstood you :) [19:22] <gwicke> and if there are cases where the onNewline / onStartOfLine state could be reverted later [19:23] <subbu> you were referring to the flag, i thought you meant we should fix this sooner than later. [19:23] <gwicke> yes, I wasn't terribly clear [19:23] <gwicke> you wrote something about following productions swallowing newlines, but I think we don't actually do that any more [19:24] <gwicke> I'm quite optimistic that updating those flags much earlier would work [19:25] <subbu> yes, it could fix it. [19:26] <subbu> you might be right reg. swallowing. it was happening earlier. but, not right now, after single-line mode and other fixes. Change-Id: Ic1d8141c04eb54a59977d0ba87bcf06bafd421e0 |
||
---|---|---|
.. | ||
html5 | ||
core-upgrade.js | ||
ext.Cite.js | ||
ext.cite.taghook.ref.js | ||
ext.core.AttributeExpander.js | ||
ext.core.BehaviorSwitchHandler.js | ||
ext.core.LinkHandler.js | ||
ext.core.ListHandler.js | ||
ext.core.NoIncludeOnly.js | ||
ext.core.ParserFunctions.js | ||
ext.core.PostExpandParagraphHandler.js | ||
ext.core.QuoteTransformer.js | ||
ext.core.Sanitizer.js | ||
ext.core.TemplateHandler.js | ||
ext.Util.js | ||
ext.util.TokenCollector.js | ||
mediawiki.ApiRequest.js | ||
mediawiki.DOMConverter.js | ||
mediawiki.DOMPostProcessor.js | ||
mediawiki.HTML5TreeBuilder.node.js | ||
mediawiki.LinearModelConverter.js | ||
mediawiki.parser.defines.js | ||
mediawiki.parser.environment.js | ||
mediawiki.parser.js | ||
mediawiki.Title.js | ||
mediawiki.tokenizer.peg.js | ||
mediawiki.TokenTransformManager.js | ||
mediawiki.WikitextSerializer.js | ||
package.json | ||
parse.js | ||
pegTokenizer.pegjs.txt | ||
README.txt |
A combined Mediawiki and html parser in JavaScript running on node.js. Please see (https://www.mediawiki.org/wiki/Future/Parser_development) for an overview of the current implementation, and instructions on running the tests. You might need to set the NODE_PATH environment variable, export NODE_PATH="node_modules" Download the dependencies: npm install Run tests: npm test