rstacruz / flatdoc

Build sites fast from Markdown
http://ricostacruz.com/flatdoc
2.68k stars 262 forks source link

Fix for HTML Keyword highlighting. #28

Closed oderwat closed 10 years ago

oderwat commented 10 years ago

The keyword highlighting in HTML code is broken if there are not attributes for a tag!

The following markdown code:

```html
<div>Test</div>

will create:
    
    <div>test</div>
    

which looks like this:

&lt;**div&gt;Test&lt;/div&gt;**

instead of:
    
    <div>test</div>
    


which looks like this:

&lt;**div**&gt;Test&lt;**/div**&gt;

This was pretty easy to fix by just adding the & (of &amp;gt;) as additional end besides of a space. I also changed the space to the /s regex so it also works in the (possible) case that a tag continues with a line break or a tab character.
rstacruz commented 10 years ago

Nice, thanks!