[gtksourceview] rst.lang: Add support for literal blocks



commit d4fe0cbfbe2c617b27db8f3664e59fdd13f64215
Author: Pierre Ossman <ossman cendio se>
Date:   Fri Oct 15 19:13:56 2021 +0200

    rst.lang: Add support for literal blocks

 data/language-specs/rst.lang | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
---
diff --git a/data/language-specs/rst.lang b/data/language-specs/rst.lang
index 2c16ca26..7d7b2db4 100644
--- a/data/language-specs/rst.lang
+++ b/data/language-specs/rst.lang
@@ -82,6 +82,24 @@
       </include>
     </context>
 
+    <context id="literal-block">
+      <include>
+        <context id="literal-indented" style-ref="code">
+          <start>^(\s*)::\s*$</start>
+          <end>^(?!(\%{1@start}   )|(\s*$))</end>
+        </context>
+        <context id="literal-quoted" style-ref="code">
+          <start>(?&lt;!:)::\s*$</start>
+          <include>
+            <context id="literal-quoted-block" end-parent="true">
+              <start>^(\s*)\S</start>
+              <end>^(?!(\%{1@start})|(\s*$))</end>
+            </context>
+          </include>
+        </context>
+      </include>
+    </context>
+
     <context id="title-adornment" style-ref="header">
       <match>^\s*(=+|\-+|`+|:+|(\.\.\.+)|'+|"+|~+|\^+|_+|\*+|\++|#+)\s*$</match>
     </context>
@@ -183,6 +201,7 @@
         <context ref="citation"/>
         <context ref="comment"/>
         <context ref="comment-single"/>
+        <context ref="literal-block"/>
         <context ref="title-adornment"/>
         <context ref="bullet"/>
         <context ref="enumerator"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]