Skip to content

Commit

Permalink
chore(docs) Small fixes in language guide and mode reference
Browse files Browse the repository at this point in the history
  • Loading branch information
edemaine committed Apr 26, 2021
1 parent add810e commit 2a0500b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions docs/language-guide.rst
Expand Up @@ -163,7 +163,7 @@ Parameters for the function are:
Markup generation
-----------------

Modes usually generate actual highlighting markup — ``<span>`` elements with specific class names that are defined by the ``className`` attribute:
Modes usually generate actual highlighting markup — ``<span>`` elements with specific class names that are defined by the ``scope`` attribute:

::

Expand All @@ -180,7 +180,7 @@ Modes usually generate actual highlighting markup — ``<span>`` elements with s
]
}

Names are not required to be unique, it's quite common to have several definitions with the same name.
Scopes are not required to be unique; it's quite common to have several definitions with the same scope.
For example, many languages have various syntaxes for strings, comments, etc…

Sometimes modes are defined only to support specific parsing rules and aren't needed in the final markup.
Expand All @@ -194,7 +194,10 @@ A classic example is an escaping sequence inside strings allowing them to contai
contains: [{begin: '\\\\.'}],
}

For such modes, the ``className`` attribute should be omitted so they won't generate excessive markup.
For such modes, the ``scope`` attribute should be omitted so they won't generate excessive markup.

For a list of all supported scope names please see the :doc:`Scopes Reference
</css-classes-reference>`.


Mode attributes
Expand Down
2 changes: 1 addition & 1 deletion docs/mode-reference.rst
Expand Up @@ -216,7 +216,7 @@ of the function as ``title``. The space(s) between would be matched, but not
highlighted.

Note: Internally, each regular expression in the array becomes a capture group
inside a larger concatenated regex. *These regular expressions many NOT include
inside a larger concatenated regex. *These regular expressions must NOT include
capture groups of their own yet.* If your regexes uses groups at all, they
**must** be non-capturing, i.e. ``(?:regex)``.

Expand Down

0 comments on commit 2a0500b

Please sign in to comment.