Massive-Wiki / massivewikibuilder

Massive Wiki Builder
MIT License
3 stars 3 forks source link

links to pages with double quotes in filenames are broken #52

Closed peterkaminski closed 10 months ago

peterkaminski commented 10 months ago

There are a couple files with double quotes in prosefusion 736ef26 that end up with broken links on the website.

peterkaminski commented 10 months ago

I've reproduced this in the bespoke-tests test-input, with the filename:

This filename has "double" quotes.md

The HTML links are created like this, with a truncation at the first double quote, double quotes inside the double-quoted href string, and a spurious =" construction at the end.

<a class="wikilink" href="/This_filename_has_" double"_quotes.html"="">This filename has "double" quotes</a>

Fix so generated HTML links to pages with double quotes in the original filename work.

(Side note: Microsoft Windows doesn't allow filenames with double quote characters, so A) repos that touch Windows probably will have had double quotes in filenames removed, and B) if somehow there are filenames with double quotes exist, MWB would have trouble writing the HTML files because Windows would refuse to create the output file. This side note does not relieve us from the responsibility to fix the problem on other operating systems like Linux and macOS, where the problem can exist.)