X-Git-Url: https://harishankar.org/repos/?p=biaweb_qt.git;a=blobdiff_plain;f=highlighter.py;h=e963a7f7c8068e02df69dd2f4865a780463a6911;hp=3213755526947638d6f15ab25563914ba85e35cf;hb=b517d55320f54925d862aca9dedb363b6d3b156d;hpb=2687a3c3b18c3a267ca60ecdd3759ed0856471e0 diff --git a/highlighter.py b/highlighter.py index 3213755..e963a7f 100644 --- a/highlighter.py +++ b/highlighter.py @@ -23,10 +23,16 @@ class SimpleHtmlHighlighter (PyQt4.QtGui.QSyntaxHighlighter): charfmt3 = PyQt4.QtGui.QTextCharFormat () charfmt3.setForeground (PyQt4.QtCore.Qt.magenta) + # for template variables - ${temp_var} + charfmt4 = PyQt4.QtGui.QTextCharFormat () + charfmt4.setForeground (PyQt4.QtCore.Qt.darkGray) + charfmt4.setFontItalic (True) + # matching regular expressions htmltagexps = [ (PyQt4.QtCore.QRegExp ("<[^<>]+>"), charfmt1), (PyQt4.QtCore.QRegExp ("\"[^\"]+\""), charfmt2), - (PyQt4.QtCore.QRegExp ("&[^;]+;"), charfmt3) + (PyQt4.QtCore.QRegExp ("&[^;]+;"), charfmt3), + (PyQt4.QtCore.QRegExp ("\$\{[^\}]+\}"), charfmt4) ] # run through the list of regular expressions to highlight