[ddoc preprocessor] Highlight multiple <word> and nested [...] in CLI switches#4422
[ddoc preprocessor] Highlight multiple <word> and nested [...] in CLI switches#4422dkorpel merged 9 commits intodlang:masterfrom
<word> and nested [...] in CLI switches#4422Conversation
|
Thanks for your pull request and interest in making D better, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
The regex version was causing `$(I word)` to be displayed in browser.
<word> and nested [...] in CLI switches
Let me know if you'd rather I do that in a separate PR |
| .map!((w){ | ||
| auto wPlain = w.filter!(c => !c.among('<', '>', '`', '\'')).to!string; | ||
| return wPlain == specialWord ? wPlain.italic: w; | ||
| }) |
There was a problem hiding this comment.
BTW removing the filtering is fine because:
- Italicizing
<foo>is not dependent on using<foo>in the flag string. 'foo'is not actually used for the HTML docs - only for the man page (even though short help is copied sometimes)- ` is not needed as matching
<foo>is now by regex, not by space splitting
dkorpel
left a comment
There was a problem hiding this comment.
Looks good as a bug fix, but eventually I want to minimize the amount of special cases and magic transformations used to build the website. I prefer to just write the desired ddoc plainly in the dmd CLI documentation.
|
`man` counterpart to HTML fix dlang/dlang.org#4422. Also remove matching of `'foo'` and `foo` in help text when `<foo>` is in flag string. This requires dlang#22741 to be merged first.
`man` counterpart to HTML fix dlang/dlang.org#4422. Also remove matching of `'foo'` and `foo` in help text when `<foo>` is in flag string. This requires #22741 to be merged first.
Fixes #4421.
Before only the first <> and first [] was matched in the flag string.
Also inner [ chars were wrongly italicised.
Before a space was added before the ] presumably because a tall italic character before runs into it. The trouble with that is it can look weird in other places, adding spaces where there shouldn't be any (e.g.
<arch>-<os>, so I removed that.Update: Also highlight any
<word>in helpText even if not in flag string.