Closed whyboris closed 2 years ago
🙇 by the way, @jgazeau 🙇 THANK YOU SO MUCH for this useful utility you created and shared with the world ❤️
I am building a Hugo website and now I can generate beautiful PDFs with your tool:
https://github.com/whyboris/utilitarianism.net/pull/41
Thank you 😊
ps - the above bug I reported doesn't matter to me - I can fix it locally in 1 second by removing the |
from page titles 👌 I'm reporting it just FYI -- feel free to close 👌
Hi @whyboris , Glad you use my library and like it 😊 Actually this is a regression from this issue. I kind of change it too hardly 😄 . What I will do is actually add an option to safely generate files by replacing all special char in the filename (as it was in the v0.0.7), and by default the filename will be the one from the title tag.
I'll try to do it this week and release right after 😉
Hi @whyboris , release 0.0.9 is out now with the safeTitle option :)
@jgazeau - 🙇 thank you again for this excellent tool ❤️ Thanks to you we now have PDFs of all the pages: https://www.utilitarianism.net/ https://github.com/whyboris/utilitarianism.net 🚀 (see the thank you at the bottom of our repository 😊 )
Steps that lead to the issue
Version
0.0.7
worked:Version
0.0.8
does notThe change with #47 results in the situation where Node tries to create a file with a
|
character and fails:Expected behavior
Remove the error-causing character
|
🤔Reproducer
Make sure the title of the webpage includes the
|
character :trollface:Solution?
Maybe include a filter to remove problematic characters during the operation of the
toFilename
helper function:https://github.com/jgazeau/website2pdf/blob/main/src/utils/helpers.ts#L35