Fastest Way To Format a Plain Text Using Javascript

Posted by Nathan Campos on Stack Overflow See other posts from Stack Overflow or by Nathan Campos
Published on 2011-03-10T00:07:53Z Indexed on 2011/03/10 0:10 UTC
Read the original article Hit count: 195

I have a huge plain text document, about 700kb which is very big for plain texts and I need to format it on cloud converting it to HTML, but the only things that I need to replace, format to HTML so it can be displayed by the browser, are bold and italic. For bold at the plain text they are like this:

Not on bold... **bold text here** not bold here

And italic like this:

Not italic... *italic text* no italic

Just like StackOverflow does for their formatting, but the problem is that I need to make it a lot faster, since the text is so big... One of my ideas was to add a page slide, so I the script just need to format some part of the text, not it all, then after the user changes the page the script would be called again, but the problem is how I can make the code for this all?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about file-io