herbsjs / herbsshelf

Dynamically generated documentation for your domain
Other
8 stars 16 forks source link

Error when using single quotes on README #39

Closed anahelenasilva closed 1 year ago

anahelenasilva commented 2 years ago

Describe the bug When using single quotes on readme.md file, herbsshelf crashes, as shown bellow:

To Reproduce

  1. Clone this repo
  2. Run npm install
  3. Run npm start:dev
  4. Access the herbsshelf endpoint
  5. See the error on devtools

I noticed that if you wrap someting in single quotes (like 'this'), the error occurs. But if I remove them, the error stops.

Expected behavior Herbsshelf should work whether or not I use single quotes in the readme file.

Screenshots image

italojs commented 2 years ago

do you have some idea about how to fix it ?

gustavobigardi commented 1 year ago

do you have some idea about how to fix it ?

I sent a PR in order to fix it. The issue was a replace for single quotes, replacing just the first occurrence of single quotes. I replaced it by using a regex to replace all the occurrences (can't use replaceAll, since the lib has compatibility with Node V14, that does not support the replaceAll method for strings)

herbsjs-robot commented 1 year ago

:tada: This issue has been resolved in version 5.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: