ID:169536
 
I'm trying to make a DM syntax highlightor (does basically the same thing as the forum <dm> tags). I've finished most of it, but I have yet to add support for single-line comments and preprocessor commands. The problem that I'm having with those two is that they take line breaks as their cue to end, and I can't figure out how to detect a line break inside of a <pre> tag. How would I detect that?
Are you doing this in Dream Maker or something else? If it's something else, you can probably just search for an "\n" since it means a new line. But, if it's in DM I wouldn't think it's possiable to use that method.

-Ryan
In response to Ryne Rekab
Ryne Rekab wrote:
Are you doing this in Dream Maker or something else?

Yup -- Dream Maker.

If it's something else, you can probably just search for an "\n" since it means a new line. But, if it's in DM I wouldn't think it's possiable to use that method.

Why wouldn't it be possible in DM?
In response to Wizkidd0123
Because you're look through a text string, and with DM it treats text strings different then other... I think.

Do a test! Do a find and replace for \ with \\. Then output it. If you find some \n then it probably is possiable.

-Ryan
I was searching for two characters -- "\" and "n" -- until Jon88 told me, in Chatters, that "\n" is one character. Thank you everybody who helped! Problem solved! =)