textpad syntax highlighting confused by apostrophe

2019-08-11 08:07发布

I'd like to know what to put in textpad's syntax file to fix the issue where, say, in an html file, you're writing a paragraph and an apostrophe creates syntax highlighting until the next aspostrophe.

Ex:

<p>Hi, I'm an example.


lol text here placeholder lorem ipsum I've died.</p>

I've placed in bold what would be color highlighted in textpad, for lack of stackoverflow coloring knowledge. :P It would be seen as similar to <a href='http://string.lol'> where you would normally use a pair of apostrophes or quotes. I realize that the issue may be in the way the syntax file is set up, where it's matching for any apostrophe instead of matching for an apostrophe not separated by a space. Ideally it would also need to match for equal signs and other common characters that would be seen directly next to an apostrophe or quote.

Here's where I believe it could be found inside the syntax file:

[Syntax]
Namespace1 = 6
IgnoreCase = No
InitKeyWordChars = A-Za-z_
KeyWordChars = A-Za-z0-9_
OperatorChars = -+*/!~%^&|=@`.,;:
KeyWordLength =
BracketChars = {[()]}
PreprocStart = #
HexPrefix = 0x
SyntaxStart = 
SyntaxEnd = 
CommentStart = /*
CommentEnd = */
CommentStartAlt = <!--
CommentEndAlt = -->
SingleComment = //
SingleCommentCol =
SingleCommentAlt = 
SingleCommentColAlt =
SingleCommentEsc =
StringsSpanLines = Yes
StringStart = "
StringEnd = "
StringAlt = '
StringEsc = \
CharStart = '
CharEnd = '
CharEsc = \

You have your String options at the bottom, but is textpad capable of accepting some kind of expression matching or regex, and if so, how would I best do this? I've looked on google and here, and the keywords are just too vague to find anything that does exist on the topic, if anything does.

Thank you for any help you can provide.

2条回答
我命由我不由天
2楼-- · 2019-08-11 08:29

You need to use

SyntaxStart = <
SyntaxEnd = >

This will restrict syntax highlighting to only be within tags, and it's the best you can do with TextPad.

查看更多
我只想做你的唯一
3楼-- · 2019-08-11 08:39

I fixed this problem by editing the line in perl5.syn that reads

StringAlt = '

to instead be

; StringAlt = '

(the leading semi-colon comments out the StringAlt setting on that line; or you could just delete that line outright).

查看更多
登录 后发表回答