jEdit Community - Resources for users of the jEdit Text Editor
solution for proper highlighting of script/style tags
Submitted by silverquick on Wednesday, 17 May, 2006 - 01:37
Hey all, I was always bothered by how SCRIPT and STYLE tags in HTML or PHP mode look kind of ugly because of how those modes have to delegate their contents to the right ruleset. This may have been discovered already but I've found a pretty simple solution. I'm not sure if I should release it to the files section though, as my mode files are pretty customized in other ways too (customized OCD style Smiling).

Basically, my new rules highlight any occurences of '<script' or '<style' as 'MARKUP', along with their matching closing tags, and delegate everything between them to a 'mediating' ruleset, which imports the rules from the TAGS ruleset (so any attributes of the style or script tag are highlighted properly), but adds a rule to delegate anything after '>' to either CSS mode or Javascript mode. Doesn't sound as simple as I thought. Smiling

Anyway, I can't get HTML to show up on this forum, so if you want to see what the rules look like in html.xml, look at this file:
http://www.flowingcreativity.net/jedit-better-rules.txt
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82349
Context Free Art (*.cfdg)   0.31   46055
BBEdit scheme   1.0   18595
JBuilder scheme   .001   18495
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293