Opened 16 years ago

Closed 16 years ago

#612 closed New Feature (duplicate)

Source code hightlighting

Reported by: anonymous Owned by:
Priority: Normal Milestone:
Component: UI : Source View Version:
Keywords: SF Confirmed Cc: saul11@…, Alfonso Martínez de Lizarrondo



building in sourcecode highlighting would be great. Parsing the source when going to html mode, and parsing it back when going to WYSIWYG mode. Should be to resource intensive.

example code (thnx @ Quist):

// parse all tags and make red
defaultTag = /(<([\s\S]*?)>)/gi;
code = code.replace(defaultTag, "<font

// give centain elements a other color
var aItems = [['style','#00FF00'], ['script','#00FF00']];
for (var i = 0; i < aItems.length; i++) {
var sTag = aItems[i][0];
var re = new RegExp("(&lt;(" + sTag + "|\/" + sTag +
")(.*?)&gt;)", "gi");
code = code.replace(re, "<font color=" + aItems[i][1]
+ ">$1</font>");
// make attribute's blue
var reAttr = new
RegExp("(=((\"|&quot;)(.*?)(\"|&quot;))( |\/|&gt;))",
code = code.replace(reAttr, "=<font

Moved from SF:

Change History (6)

comment:1 Changed 16 years ago by Martin Kou

Cc: saul11@… Alfonso Martínez de Lizarrondo added
Reporter: changed from Martin Kou to anonymous

Incorporated could be a system like or or only a higlight script (permission needed of author)

Moved from SF. Original poster: saul11

Comments from (dup)

A syntax highlighting text editor in javascript. Distributed under GNU General Public License (GPL).

Very cool SyntaxHighlighter:

dp.SyntaxHighlighter Distributed under GNU Library or "Lesser" General Public License (LGPL)

Moved from SF. Original poster: alfonsoml

comment:2 Changed 16 years ago by Alfonso Martínez de Lizarrondo

Component: GeneralUI : Source View

#128 and #530 are dups

comment:3 Changed 16 years ago by Frederico Caldeira Knabben

Interesting approach to "background" highlighting:

comment:5 Changed 16 years ago by Wojciech Olchawa

Keywords: Confirmed added

This is a DUP of #602 however there is a lot of information regarding to the request in this ticket so I'm leaving it opened.

comment:6 Changed 16 years ago by Wojciech Olchawa

Resolution: duplicate
Status: newclosed

DUP of #602

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy