dniccum / nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.
MIT License
37 stars 15 forks source link

Escape periods in "replaceLinks" function #6

Closed calvinps closed 5 years ago

calvinps commented 5 years ago

In the MarkdownUtility class, the function replaceLinks has the following line:

$output = preg_replace("/(\.md|.text|.mdown|.mkdn|.mkd|.mdwn|mdtxt|.Rmd|.mdtext)/i",'"',$output);

but only the first period is escaped. For me, this caused several places in my content where the word "text" (not a file extension) was used to be replaced with just a double quote. Adding in backslashes before every period fixed the bug.

dniccum commented 5 years ago

Thanks for the addition. PR has been merged and released.