| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY inlinestart "(?:^|(?<=[-\s'"\(\[{</:‘“’«¡¿‐‑‒–— ]))"> |
| 5 |
<!ENTITY inlineend "(?=[-\s’”»‐‑‒–— '"\)\]}>/:\.,;!\?\\]|$)"> |
| 6 |
<!ENTITY SimpleReferenceNameChars "\w_\.:\+\-"> |
| 7 |
|
| 8 |
<!-- Keep in sync with Markdown --> |
| 9 |
<!ENTITY startlink "(?:https?|ftp)\://"> |
| 10 |
]> |
| 11 |
<!-- |
| 12 |
This file is part of KDE's kate project. |
| 13 |
|
| 14 |
Copyright 2010 Matt Williams ([email protected]) |
| 15 |
Copyright 2014 Matthew Woehlke ([email protected]) |
| 16 |
--> |
| 17 |
<language name="reStructuredText" extensions="*.rst" section="Markup" mimetype="text/x-rst" version="9" kateversion="5.0" casesensitive="1"> |
| 18 |
|
| 19 |
<highlighting> |
| 20 |
|
| 21 |
<contexts> |
| 22 |
<context name="Normal" attribute="Normal" lineEndContext="#stay"> |
| 23 |
<RegExpr attribute="Bold" context="#stay" String="&inlinestart;\*\*[^\s].*\*\*&inlineend;" minimal="true"/> |
| 24 |
<RegExpr attribute="Italic" context="#stay" String="&inlinestart;\*[^\s].*\*&inlineend;" minimal="true"/> |
| 25 |
<IncludeRules context="InlineMarkup"/> |
| 26 |
<RegExpr attribute="Footnote" context="#stay" String="^\s*\.\. \[(\d+|#|\*|#[&SimpleReferenceNameChars;]+)\]\s" minimal="true" column="0"/> |
| 27 |
<RegExpr attribute="Citation" context="#stay" String="^\s*\.\. \[[&SimpleReferenceNameChars;]+\]\s" minimal="true" column="0"/> |
| 28 |
<RegExpr attribute="HyperlinkTarget" context="#stay" String="^\s*(\.\. (__:|_[&SimpleReferenceNameChars; ]+:(\s|$))|__ )" minimal="true" column="0"/> |
| 29 |
<StringDetect attribute="Code" String=".. code-block::" context="CodeBlock" firstNonSpace="true"/> |
| 30 |
<StringDetect attribute="Code" String=".. code::" context="CodeBlock" firstNonSpace="true"/> |
| 31 |
<RegExpr attribute="Directive" context="#stay" String="^\s*\.\. ([\w\-_\.]+)(:[\w\-_\.]+)*::(\s|$)" minimal="true" column="0"/> |
| 32 |
<RegExpr attribute="Code" String="::$" context="CodeBlock" /> |
| 33 |
<RegExpr attribute="SubstitutionDefinition" context="#stay" String="^\s*\.\. \|[&SimpleReferenceNameChars; ]+\|\s+[&SimpleReferenceNameChars;]+::\s" minimal="true" column="0"/> |
| 34 |
<RegExpr attribute="Field" String=":(?=([^:]*\\:)*[^:]*:(\s|$))" context="Field" firstNonSpace="true"/> |
| 35 |
<RegExpr attribute="Comment" context="Comment" String="^(\s*)\.\.(?:\s|$)(?![\w\-_\.]+(?::[\w\-_\.]+)*::(?:\s|$))" column="0"/> |
| 36 |
|
| 37 |
<!-- Keep in sync with Markdown’s implicitlink entity --> |
| 38 |
<RegExpr attribute="StandaloneHyperlink" context="#stay" String="\b&startlink;[^">\s`\)]*[^\s!"'`\(\)\*,\.:;<>\?~\]\}\\](?=[[:punct:]]*(?:[\s\)]|$))" /> |
| 39 |
|
| 40 |
</context> |
| 41 |
|
| 42 |
<context name="InlineMarkup" attribute="Normal" lineEndContext="#stay"> |
| 43 |
<RegExpr attribute="InlineLiteral" context="#stay" String="&inlinestart;``[^\s].*``&inlineend;" minimal="true"/> |
| 44 |
<RegExpr attribute="SubstitutionReference" context="#stay" String="&inlinestart;\|[^\s].*\|&inlineend;" minimal="true"/> |
| 45 |
<RegExpr attribute="InlineInternalTarget" context="#stay" String="&inlinestart;_`[^\s].*`&inlineend;" minimal="true"/> |
| 46 |
<RegExpr attribute="FootnoteReference" context="#stay" String="&inlinestart;\[[&SimpleReferenceNameChars;]+\]_&inlineend;" minimal="true"/> |
| 47 |
<RegExpr attribute="HyperlinkReference" context="#stay" String="&inlinestart;(`[^\s].*`|\w+)_&inlineend;" minimal="true"/> |
| 48 |
<RegExpr attribute="InterpretedText" context="TrailingRole" String="&inlinestart;`[^\s].*`(?=:([\w\-_\.\+]+)(:[\w\-_\.\+]+)*:)" minimal="true"/> |
| 49 |
<RegExpr attribute="Role" String=":([\w\-_\.\+]+)(:[\w\-_\.\+]+)*:(?=`)" context="Role"/> |
| 50 |
<RegExpr attribute="DefaultRole" context="#stay" String="&inlinestart;`[^\s].*`&inlineend;" minimal="true"/> |
| 51 |
</context> |
| 52 |
|
| 53 |
<context name="Field" attribute="Field" lineEndContext="#stay"> |
| 54 |
<DetectChar attribute="Field" context="#pop" char=":"/> |
| 55 |
<Detect2Chars attribute="Field" context="#stay" char="\" char1=":"/> |
| 56 |
<RegExpr attribute="FieldBold" context="#stay" String="&inlinestart;\*\*[^\s].*\*\*&inlineend;" minimal="true"/> |
| 57 |
<RegExpr attribute="FieldItalic" context="#stay" String="&inlinestart;\*[^\s].*\*&inlineend;" minimal="true"/> |
| 58 |
<IncludeRules context="InlineMarkup"/> |
| 59 |
</context> |
| 60 |
<context name="InterpretedText" attribute="InterpretedText" lineEndContext="#pop"> |
| 61 |
<DetectChar attribute="InterpretedText" char="`" context="#pop" /> |
| 62 |
</context> |
| 63 |
<context name="Role" attribute="Role" lineEndContext="#pop"> |
| 64 |
<DetectChar attribute="InterpretedText" char="`" context="#pop!InterpretedText" /> |
| 65 |
</context> |
| 66 |
<context name="TrailingRole" attribute="Role" lineEndContext="#pop"> |
| 67 |
<RegExpr attribute="Role" String=":[\w\-_\.\+]+:" context="#pop"/> |
| 68 |
</context> |
| 69 |
<context name="Comment" attribute="Comment" lineEndContext="#stay" dynamic="true"> |
| 70 |
<StringDetect attribute="Code" String="%1 " context="#stay" column="0" dynamic="true"/> |
| 71 |
<RegExpr attribute="Normal" String="^." lookAhead="true" column="0" context="#pop"/> |
| 72 |
<IncludeRules context="##Comments"/> |
| 73 |
</context> |
| 74 |
|
| 75 |
<context name="CodeBlock" attribute="Code" lineEndContext="#stay"> |
| 76 |
<RegExpr attribute="Code" String="^(\s+)(?=\S)" context="Code" column="0"/> |
| 77 |
</context> |
| 78 |
|
| 79 |
<context name="Code" attribute="Code" lineEndContext="#stay" dynamic="true"> |
| 80 |
<StringDetect attribute="Code" String="%1" context="#stay" column="0" dynamic="true"/> |
| 81 |
<RegExpr attribute="Normal" String="^." lookAhead="true" context="#pop#pop" column="0"/> |
| 82 |
</context> |
| 83 |
</contexts> |
| 84 |
|
| 85 |
<itemDatas> |
| 86 |
<itemData name="Normal" defStyleNum="dsNormal" /> |
| 87 |
<itemData name="Bold" defStyleNum="dsNormal" bold="1" /> |
| 88 |
<itemData name="Italic" defStyleNum="dsNormal" italic="1" /> |
| 89 |
<itemData name="InlineLiteral" defStyleNum="dsDataType" /> |
| 90 |
<itemData name="SubstitutionReference" defStyleNum="dsFunction" /> |
| 91 |
<itemData name="InlineInternalTarget" defStyleNum="dsFunction" /> |
| 92 |
<itemData name="FootnoteReference" defStyleNum="dsOthers" /> |
| 93 |
<itemData name="InterpretedText" defStyleNum="dsDecVal" /> |
| 94 |
<itemData name="HyperlinkReference" defStyleNum="dsOthers" /> |
| 95 |
<itemData name="Field" defStyleNum="dsFunction" /> |
| 96 |
<itemData name="FieldBold" defStyleNum="dsFunction" bold="1" /> |
| 97 |
<itemData name="FieldItalic" defStyleNum="dsFunction" italic="1" /> |
| 98 |
<itemData name="Footnote" defStyleNum="dsDataType" /> |
| 99 |
<itemData name="Citation" defStyleNum="dsDataType" /> |
| 100 |
<itemData name="HyperlinkTarget" defStyleNum="dsDataType" /> |
| 101 |
<itemData name="Directive" defStyleNum="dsDataType" /> |
| 102 |
<itemData name="SubstitutionDefinition" defStyleNum="dsDataType" /> |
| 103 |
<itemData name="Role" defStyleNum="dsKeyword" /> |
| 104 |
<itemData name="DefaultRole" defStyleNum="dsDecVal" /> |
| 105 |
<itemData name="Code" defStyleNum="dsDataType" /> |
| 106 |
<itemData name="Comment" defStyleNum="dsComment" /> |
| 107 |
<itemData name="StandaloneHyperlink" defStyleNum="dsOthers" /> |
| 108 |
</itemDatas> |
| 109 |
|
| 110 |
</highlighting> |
| 111 |
|
| 112 |
<general> |
| 113 |
<folding indentationsensitive="true" /> |
| 114 |
<comments> |
| 115 |
<comment name="singleLine" start=".."/> |
| 116 |
</comments> |
| 117 |
</general> |
| 118 |
|
| 119 |
</language> |
| 120 |
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> |