Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<?xml version="1.0" encoding="UTF-8"?>
This file is part of GtkSourceView
Authors: Duncan Coutts
Copyright (C) 2007 Duncan Coutts <>
GtkSourceView is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
GtkSourceView is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<language id="haskell-literate" _name="Literate Haskell" version="2.0" _section="Sources">
<property name="mimetypes">text/x-literate-haskell</property>
<property name="globs">*.lhs</property>
<style id="url" _name="URL" map-to="def:underlined"/>
<style id="link-text" _name="Link Text" map-to="def:identifier"/>
<style id="emphasis" _name="Emphasis" map-to="def:doc-comment-element"/>
<style id="strong-emphasis" _name="Strong Emphasis" map-to="xml:namespace"/>
<context id="haskell-literate">
<context ref="def:shebang"/>
<context ref="c:if0-comment"/>
<context ref="c:include"/>
<context ref="c:preprocessor"/>
<context ref="def:in-comment"/>
<context id="line-code" end-at-line-end="true">
<context ref="haskell:body"/>
<context id="block-code">
<context ref="haskell:body" />
<!-- following code from markdown highlighter syntax: -->
<!-- Examples:
<!-- Note: regular expressions are based from function `_DoAutoLinks` from (see <>). -->
<context id="automatic-link" class="no-spell-check">
<match case-sensitive="false" extended="true">
(((mailto:)?[a-z0-9.-]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+) | # E-mail.
((https?|ftp):[^'">\s]+)) # URL.
<context sub-pattern="1" style-ref="url"/>
<!-- Examples:
[link text](
[link text](<>)
[link text]( /folder/page.html "Title" )
<context id="inline-link">
<match extended="true">
\[(.*?)\] # Link text.
\( # Literal opening parenthesis.
[ \t]* # Optional spaces or tabs after the opening parenthesis.
(&lt;(.*?)&gt; | # URL with brackets.
(.*?)) # URL without brackets.
([ \t]+(".*?"))? # Optional title.
[ \t]* # Optional spaces or tabs before the closing parenthesis.
\) # Literal closing parenthesis.
<context sub-pattern="1" style-ref="link-text"/>
<context sub-pattern="3" class="no-spell-check" style-ref="url"/>
<context sub-pattern="4" class="no-spell-check" style-ref="url"/>
<context sub-pattern="6" style-ref="attribute-value"/>
<!-- Examples:
Lorem _ipsum dolor_ sit amet.
Here's an _emphasized text containing an underscore (\_)_.
<context id="underscores-emphasis" style-ref="emphasis">
<match>(?&lt;!_)_[^_ \t].*?(?&lt;!\\|_| |\t)_(?!_)</match>
<!-- Examples:
Lorem *ipsum dolor* sit amet.
Here's an *emphasized text containing an asterisk (\*)*.
<context id="asterisks-emphasis" style-ref="emphasis">
<match>(?&lt;!\*)\*[^\* \t].*?(?&lt;!\\|\*| |\t)\*(?!\*)</match>
<!-- Examples:
Lorem __ipsum dolor__ sit amet.
Here's a __strongly emphasized text containing an underscore (\_)__.
<context id="underscores-strong-emphasis" style-ref="strong-emphasis">
<match>__[^_ \t].*?(?&lt;!\\|_| |\t)__</match>
<!-- Examples:
Lorem **ipsum dolor** sit amet.
Here's a **strongly emphasized text containing an asterisk (\*).**
<context id="asterisks-strong-emphasis" style-ref="strong-emphasis">
<match>\*\*[^\* \t].*?(?&lt;!\\|\*| |\t)\*\*</match>
<!-- end markdown code -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment