Disabled backtick escaping

Fixes issue #2377 by removing the ability to escape backticks in backticks in compliance with asciidoc's behaviour. Adjusted hooks.asciidoc, keys.asciidoc, and command-parsing.asciidoc to match accordingly.
This commit is contained in:
Cedric Sodhi 2020-10-22 14:39:10 +02:00
parent 9a5cf2fc9f
commit 221fc38bd9
4 changed files with 13 additions and 19 deletions

View File

@ -69,12 +69,12 @@ No other escaping takes place in balanced strings.
Other words are non-quoted. Non-quoted words end either on a whitespaces Other words are non-quoted. Non-quoted words end either on a whitespaces
or a `;`. or a `;`.
If they start with `\\` followed by `%`, `'` or `"`, then that leading If they start with `\` followed by `%`, `'` or `"`, then that leading
`\\` is discarded. `\` is discarded.
If a whitespace or `;` is preceded by `\\`, then the `\\` is discarded If a whitespace or `;` is preceded by `\`, then the `\` is discarded
and the whitespace or `;` becomes part of the word. Any other `\\` and the whitespace or `;` becomes part of the word. Any other `\`
is treated as a literal `\\`. is treated as a literal `\`.
== Typed Expansions == Typed Expansions

View File

@ -205,17 +205,10 @@ vars are available:
== Disabling Hooks == Disabling Hooks
Any normal mode command can be prefixed with `\ ` which will disable hook Hooks can be disabled temporarily by prefixing any normal mode command by `\`
execution for the duration of the command (including the duration of modes (see <<keys#,`:doc keys`>>) and permanently by setting the `disabled_hooks` option
the command could move to, so `\i` will disable hooks for the whole insert which accepts a regex describing which hooks won't be executed. For example
session). indentation hooks can be disabled with '.*-indent'.
As autoindentation is implemented in terms of hooks, this can be used to
disable it when pasting text.
A less temporary alternative is to set the `disabled_hooks` option which
accepts a regex describing which hooks won't be executed.
For example indentation hooks can be disabled with '.*-indent'.
Finally, hook execution can be disabled while using the `execute-keys` or Finally, hook execution can be disabled while using the `execute-keys` or
`evaluate-commands` commands by using the `-no-hooks` switch. `evaluate-commands` commands by using the `-no-hooks` switch.

View File

@ -85,9 +85,10 @@ the right of the end of each selection.
== Disabling Hooks == Disabling Hooks
Any normal mode command can be prefixed with *\* which will disable hook execution Any normal mode command can be prefixed with `\` which will disable hook execution
for the duration for the command (including the duration of modes the command could for the duration for the command (including the duration of modes the command could
move to, so *\i* will disable hooks for the whole insert session). move to, so `\i` will disable hooks for the whole insert session) (see
<<hooks#,`:doc hooks`>>).
As autoindentation is implemented in terms of hooks, this can be used to disable As autoindentation is implemented in terms of hooks, this can be used to disable
it when pasting text. it when pasting text.

View File

@ -117,7 +117,7 @@ define-command -params 1 -hidden doc-render %{
set-option buffer doc_render_ranges %val{timestamp} set-option buffer doc_render_ranges %val{timestamp}
doc-render-regex \B(?<!\\)\*(?=\S)[^\n]+?(?<=\S)(?<!\\)\*\B \A|.\z 'H' default+b doc-render-regex \B(?<!\\)\*(?=\S)[^\n]+?(?<=\S)(?<!\\)\*\B \A|.\z 'H' default+b
doc-render-regex \b(?<!\\)_(?=\S)[^\n]+?(?<=\S)(?<!\\)_\b \A|.\z 'H' default+i doc-render-regex \b(?<!\\)_(?=\S)[^\n]+?(?<=\S)(?<!\\)_\b \A|.\z 'H' default+i
doc-render-regex \B(?<!\\)`(?=\S)[^\n]+?(?<=\S)(?<!\\)`\B \A|.\z 'H' mono doc-render-regex \B(?<!\\)`(?=\S)[^\n]+?(?<=\S)`\B \A|.\z 'H' mono
doc-render-regex ^=\h+[^\n]+ ^=\h+ '~' title doc-render-regex ^=\h+[^\n]+ ^=\h+ '~' title
doc-render-regex ^={2,}\h+[^\n]+ ^={2,}\h+ '' header doc-render-regex ^={2,}\h+[^\n]+ ^={2,}\h+ '' header
doc-render-regex ^\h*-{2,}\n\h*.*?^\h*-{2,}\n ^\h*-{2,}\n '' block doc-render-regex ^\h*-{2,}\n\h*.*?^\h*-{2,}\n ^\h*-{2,}\n '' block