html - How to highlight syntax? -
i want lean how highlight syntax of various programming , markup languages. admit have no prior knowledge of might off-topic.
say, example, want highlight html
tags. think can done use regex
find tags.
can find tags using regex
, start , end position. then, can change color of particular text.
however, above approach not work if tags had attributes them. <img src="...">
so, can please guide me how how can achieved.
third-party api fine learn how can done :)
you want highlight html code? can use syntaxhighlighter javascript library this.
if want learn how, see css syntaxhighlighter 2.0: short tutorial on how create own syntax highlighter.
also, try simple search “how build syntax highlighter”.
Comments
Post a Comment