Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F8820
behavior_switch.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 22 2014, 12:09 AM
2014-11-22 00:09:52 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
behavior_switch.patch
View Options
Index: modules/parser/pegTokenizer.pegjs.txt
===================================================================
--- modules/parser/pegTokenizer.pegjs.txt (revision 114350)
+++ modules/parser/pegTokenizer.pegjs.txt (working copy)
@@ -439,6 +454,7 @@
// avoid a paragraph if we know that the line starts with a block tag
/ bt:block_tag { return [bt] }
) { return r; }
+ / behavior_switch
/ paragraph
// Inlineline includes generic tags; wrapped into paragraphs in token
// transform and DOM postprocessor
@@ -480,7 +496,15 @@
/ pre_indent
/ pre
+/*
+ * Behavior switches are layout commands like __NOTOC__
+ */
+behavior_switch_magic_word = "NOTOC" / "FORCETOC" / "TOC" / "NOEDITSECTION" / "NEWSECTIONLINK" / "NONEWSECTIONLINK" / "NOGALLERY" / "HIDDENCAT" / "NOCONTENTCONVERT" / "NOCC" / "NOTITLECONVERT" / "NOTC" / "START" / "END" / "INDEX" / "NOINDEX" / "STATICREDIRECT"
+behavior_switch = "__" w:behavior_switch_magic_word "__" {
+ return true;
+ }
+
/*
* A paragraph. We don't emit 'p' tokens to avoid issues with template
* transclusions, <p> tags in the source and the like. Instead, we perform
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8335
Default Alt Text
behavior_switch.patch (1 KB)
Attached To
Mode
T37392: VisualEditor: behavior switches are saved in parser environment
Attached
Detach File
Event Timeline
Log In to Comment