xml.nanorc (721B)
1 ## Syntax highlighting for XML files. 2 3 ## Original author: Josef Schugt 4 5 syntax xml "\.([jrsx]html?|jnlp|mml|pom|rng|sgml?|svg|w[as]dl|wsdd|xjb|xml|xs(d|lt?)|xul)$" 6 header "<\?xml.*version=.*\?>" 7 magic "(XML|SGML) (sub)?document" 8 comment "<!--|-->" 9 10 # First the entire content of the tag (for the attributes): 11 color green start="<" end=">" 12 13 # The angled brackets and the name of the tag: 14 color cyan "<[^> ]+|/?>" 15 16 # The strings inside the tag: 17 color magenta ""[^"]*"" 18 19 # Prolog stuff: 20 color #888 "<\?.+\?>|<!DOCTYPE[^>]+>|\]>" 21 color #888 start="<!DOCTYPE[^>]*$" end="^[^<]*>" 22 23 # Comments: 24 color yellow start="<!--" end="-->" 25 26 # Entities (custom and predefined): 27 color pink "&[^; ]+;" 28 color red "&(amp|apos|gt|lt|quot);"