Page MenuHomePhabricator

behavior_switch.patch

Authored By
bzimport
Nov 22 2014, 12:09 AM
Size
1 KB
Referenced Files
None
Subscribers
None

behavior_switch.patch

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

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8335
Default Alt Text
behavior_switch.patch (1 KB)

Event Timeline