@electron/lint-roller 1.11.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,5 +23,6 @@
23
23
  "br_spaces": 0
24
24
  },
25
25
  "single-h1": false,
26
- "no-inline-html": false
26
+ "no-inline-html": false,
27
+ "no-angle-brackets": false
27
28
  }
@@ -0,0 +1,25 @@
1
+ const { addError, filterTokens } = require('markdownlint/helpers');
2
+
3
+ module.exports = {
4
+ names: ['EMD002', 'no-angle-brackets'],
5
+ description: 'No unescaped opening angle brackets in text (does not play nice with MDX)',
6
+ tags: ['brackets'],
7
+ function: function EMD002(params, onError) {
8
+ filterTokens(params, 'inline', (token) => {
9
+ for (const childToken of token.children) {
10
+ // childToken.line has the raw content, but may also contain
11
+ // more content than just childToken.content. This may cause
12
+ // the same line to produce multiple errors, unfortunately.
13
+ if (
14
+ childToken.type === 'text' &&
15
+ childToken.markup !== '<' &&
16
+ childToken.markup !== '<' &&
17
+ childToken.content.includes('<') &&
18
+ childToken.line.match(/(?<!\\)</g) !== null
19
+ ) {
20
+ addError(onError, token.lineNumber, 'Unescaped opening angle bracket');
21
+ }
22
+ }
23
+ });
24
+ },
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electron/lint-roller",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "description": "Markdown linting helpers for Electron org repos",
5
5
  "engines": {
6
6
  "node": ">=14.0.0"