yakivmospan / github-wikito-converter

Generate HTML & PDF documentation from Github wiki or any other markdown-based wiki.
Other
296 stars 52 forks source link

Problem with md file that contains [ or ] in the filename #37

Open sibylenricomessina opened 6 years ago

sibylenricomessina commented 6 years ago

Hi,

I've a problem. All the *.md files that contain a [ or ] character are ignored by the gwtc command.

Every page in my github-wiki starts with a prefix, contained between two square brackets, that identifies the category of the page. For example:

[Guide] How to bla bla

When I execute the command gwtc -v ./repository.wiki I obtain the following messages:

PS D:\Repositories> gwtc -v .\repository.wiki\
debug:   gwc launched with options format=html, output=./, filename=documentation, title=Documentation , logoImage=null, footer=null, pdfPageCount=null, tocFile=repository.wiki\_Sidebar.md, tocLevel=3, highlightTheme=github, userCssFile=null, verbose=true, disableInlineAssets=false
debug:   Found 42 markdown files and 42 links pointing to them in TOC
debug:   Generating html: 0 pages to generate
info:    html file written: documentation.html
documentation.html

It seems that the TOC file (in this case the _Sidebar.md) is correctly parsed and the pages are detected, but the corresponding HTML is not generated inside the documentation.html file.

Can you fix this issue?

Thank you

drc-gcoakley commented 5 years ago

A similar issue occurs with parentheses in the filename. In this case it generates the html files but, the links to them are incorrect. For example, a page with the following source link:

[star(middle)end](http://domain/path/wiki/start(middle)end)

will generate a TOC link like this:

<a href="http://domain/path/wiki/start(middle">start(middle)end</a>end

Note, two problems resulted. First the URL is truncated at (before) the closing parenthesis. Second, the part of the page name after the closing parenthesis is repeated after the HTML Anchor is closed.

HayDegha0917 commented 5 years ago

Same issue with pages containing semi-colons. In general, I think the page names are not escaped correctly.