Bug 18361 – Ddoc: support ability to opt out of automatic keyword highlighting in text
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-02-03T17:13:30Z
Last change time
2018-02-10T01:57:08Z
Assigned to
No Owner
Creator
hsteoh
Comments
Comment #0 by hsteoh — 2018-02-03T17:13:30Z
Currently, ddoc will automatically highlight any word in running text that happens to coincide with keywords, module names, or function parameters. Unfortunately, if any of the foregoing happen to be a common word, the text will be full of unintentional highlights, and would need a proliferation of prefixed '_' to suppress this behaviour on every unwanted occurrence.
Ddoc should provide a way to opt out of this behaviour.
Comment #1 by hsteoh — 2018-02-03T17:16:02Z
Currently, the automatically highlighted text is put into the DDOC_PSYMBOL, DDOC_KEYWORD, and DDOC_PARAM macros. If the automatic highlights were to be replaced with DDOC_AUTO_PSYMBOL, DDOC_AUTO_KEYWORD, DDOC_AUTO_PARAM instead, with the default definitions of these macros pointing to the foregoing three respective macros, then it would provide the user a way to override this behaviour, e.g., by redefining these macros to just return the raw text instead.
Comment #2 by github-bugzilla — 2018-02-10T01:57:07Z
Commits pushed to master at https://github.com/dlang/dmdhttps://github.com/dlang/dmd/commit/9b439afcb10fa81c76cc1a544133f387079fe289
Fix issue 18361: [ddoc] redirect automatically highlighted text in replaceable macros.
Basically, this is to give the user the ability to opt out of automatic
keyword highlighting in doc text, in the cases where a proliferation of
`_`s would be needed to suppress this behaviour.
The default behaviour is not changed; the default ddoc theme will still
redirect the new macros to the old DDOC_PSYMBOL, DDOC_KEYWORD,
DDOC_PARAM.
https://github.com/dlang/dmd/commit/ab77b875a64b27db17584fe5a7a2678dc1cecadb
Merge pull request #7834 from quickfur/ddoc_autohilite
Fix issue 18361: [ddoc] redirect automatically highlighted text in re…
merged-on-behalf-of: unknown