New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shoes Manual string mishandling cause an error #51
Comments
The value of str at the beginnig of dewikify_p for the arc method when you navigate to _Slots > Art_:
The value of str when you go to Search, type oval and click arc method:
|
Line 29 in dewikify_hi will cause a terms to be marked up for highlighting. Line 39 in dewikify_p will do the actual highlighting. https://github.com/Shoes3/shoes3/blob/master/lib/shoes/help.rb#L29 gsub(/#{Regexp::quote(terms)}/i, '@\0@'). https://github.com/Shoes3/shoes3/blob/master/lib/shoes/help.rb#L39 gsub(/@(.+?)@/m, '", strong("\1", :fill => yellow), "'). The offending markup in manual-en.txt is [[oval]] because it becomes [[@Oval@]] when highlighted. The fall through gsub will first treat @Oval@ generating a strong emphasis and then treat [[]] trying to generate a link to open a section/method, resulting in a disaster. |
SOLUTION: Insert on line 39, https://github.com/Shoes3/shoes3/blob/master/lib/shoes/help.rb#L39 gsub(/\[\[(.+\.)?@(.+?)@\]\]/m, '", link(strong("\2".empty? ? "\1" : "\2" , :fill => yellow)) { open_link("\1\2") }, "'). Also, change [[oval]] for [[Art.oval]] in https://github.com/Shoes3/shoes3/blob/master/static/manual-en.txt#L1683. |
Unbalanced, unescaped double quotes seem to cause the error.
TESTING SCENARIO
SHOES CONSOLE
Description for arc is missing
EXPECTED RESULT
RELEVANT FILES
https://github.com/Shoes3/shoes3/blob/master/lib/shoes/help.rb
https://github.com/Shoes3/shoes3/blob/master/static/manual-en.txt
The text was updated successfully, but these errors were encountered: