roffit: fix special characters and broken links #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Regarding some suggested edits:
Unable to achieve fix with text2name and do_encode.
In short - new things break.
Quick takeaway ( where - (1) should be => (2) becomes ):
name="--any-option" => name=""--any-option" ("" at start)
name="ANY_NAMES" => name="ANYNAMES" (_ is removed)
For details see:
collapsed section
Detailed report (explains above):
Since curl.1 is a good use case for thoroughly testing a roffit
build I made two files, running "diff" command on them:
Below are sample outcomes from two instances of build, and then results
from using current edits.
do_encode --- example case removes ":
results in:
name=""--any-option" (2 "" at start)
text2name --- example case adds special characters to $text:
results in:
name="socks5h://" (should be name="socks5h").
or
name="AUNDERSCORE" (shoud be name="A_UNDERSCORE").
Several variations of the above edits were done with similar (if not the same) outcome.
So in conclusion; either my approaches were flawed, or I need to study the roffit
file some more.
When "diff" ran using -- 2. with current pull roffit --
Edits
Reordered htmlentity variable to be same order as call in do_encode (excluding ").
Edited regular expression for special character options to fix a missed bug
that removed inline comma in option text. (i.e. "-? --opt" => "-?, --opt").
Removed condition in field_anchor subroutine to reduce line numbers,
moving line needed to line number 289.