MakeupXml

View Source

A Makeup lexer for XML.

This lexer is not fully comprehensive, but should be able to process the vast majority of XML documents with good results. It matches opening and closing tags as delimiters for nice highlighting.

Installation

Add makeup_xml to your dependencies in mix.exs:

def deps do
  [
    {:makeup_xml, "~> 0.1.0"}
  ]
end

The lexer is automatically registered to Makeup for the XML language and .xml file extension.

Example

When processed using ExDoc the following serves as an example of highlighting with this lexer. Run mix docs to generate the documentation or see the result on HexDocs.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE note SYSTEM "Note.dtd">
<?php echo "hi"; ?>
<note>
  <to>Joni</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
  <!-- This is a comment -->
  <footer lang="en-US" data-info="signature">Best regards</footer>
</note>