jeromegn / DocumentUp

Pretty documentation generator for Github projects with proper Readme.
http://documentup.com
883 stars 90 forks source link

Fix headers containing markdown #64

Closed ForbesLindesay closed 9 years ago

ForbesLindesay commented 11 years ago

At the moment they just display the markdown as plain text in the table of contents:

http://documentup.com/substack/stream-handbook

jeromegn commented 11 years ago

Tests are required to make sure this is really having the desired effect and doesn't break again in the future.

ForbesLindesay commented 11 years ago

I'm going to struggle to write tests without being able to clone it locally (I don't have a unix computer to hand). The regex replacements are pretty robust. The first strips all html tags from the text, because you don't actually want to display the headings as anything other than plain text in the table of contents.

The second and third replacements are added to escape the HTML. My guess is that these are not actually wanted though, so I'll remove them. I imagine you do the escaping when you render the table of contents anyway.

Trim had to be added because sometimes the markdown parser will introduce a new-line.

jeromegn commented 11 years ago

@ForbesLindesay I'm puzzled. A have a file or directory with a comma in it? That's weird. I haven't noticed. Can you point me to it? Maybe try downloading the repo as a zip archive and extracting it?

You can still write tests and whenever you push to Github, Travis will run them. I realize this is less than ideal, but it does work. Since the feature is rather simple, it could be done.

ForbesLindesay commented 11 years ago

In this folder there are lots of folders with colons (:) in them.

stephenmathieson commented 11 years ago

according to this, the windows issue has been resolved, but will require an update to the node-replay module

ForbesLindesay commented 11 years ago

Yes, you would also need to rename all the folders with : in them by replacing : with -

jeromegn commented 11 years ago

Here we go. Sorry for the HUGE delay in getting this done...

Can you now make sure these tests pass with your changes? Add some tests if necessary.

jeromegn commented 9 years ago

I think this just works now. There has been a complete rewrite.