Skip to content

Commit 67b36a0

Browse files
committed
Rename horizontalRule to thematicBreak
Closes GH-143. Closes GH-148. Related to syntax-tree/mdast#3. Related to http://spec.commonmark.org/0.23/.
1 parent 070d977 commit 67b36a0

File tree

72 files changed

+166
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+166
-166
lines changed

doc/remarksetting.7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ The following constructs are not allowed:
185185
brackets, `<` and `>`);
186186

187187
* Lazy **Blockquote** continuation—lines not preceded by a closing angle
188-
bracket (`>`)—for **List**s, **Code**, and **HorizontalRule**.
188+
bracket (`>`)—for **List**s, **Code**, and **ThematicBreak**.
189189

190190
The following document:
191191

lib/parse.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var CODE_INDENT_LENGTH = 4;
4949
var MIN_FENCE_COUNT = 3;
5050
var MAX_ATX_COUNT = 6;
5151
var MAX_LINE_HEADING_INDENT = 3;
52-
var HORIZONTAL_RULE_MARKER_COUNT = 3;
52+
var THEMATIC_BREAK_MARKER_COUNT = 3;
5353
var MIN_CLOSING_HTML_NEWLINE_COUNT = 2;
5454
var MIN_BREAK_LENGTH = 2;
5555
var MIN_TABLE_COLUMNS = 2;
@@ -186,7 +186,7 @@ var CDATA_END_LENGTH = CDATA_END.length;
186186
* Node types.
187187
*/
188188

189-
var T_HORIZONTAL_RULE = 'horizontalRule';
189+
var T_THEMATIC_BREAK = 'thematicBreak';
190190
var T_HTML = 'html';
191191
var T_YAML = 'yaml';
192192
var T_TABLE = 'table';
@@ -1388,14 +1388,14 @@ function tokenizeLineHeading(eat, value, silent) {
13881388
* Tokenise a horizontal rule.
13891389
*
13901390
* @example
1391-
* tokenizeHorizontalRule(eat, '***');
1391+
* tokenizeThematicBreak(eat, '***');
13921392
*
13931393
* @param {function(string)} eat - Eater.
13941394
* @param {string} value - Rest of content.
13951395
* @param {boolean?} [silent] - Whether this is a dry run.
1396-
* @return {Node?|boolean} - `horizontalRule` node.
1396+
* @return {Node?|boolean} - `thematicBreak` node.
13971397
*/
1398-
function tokenizeHorizontalRule(eat, value, silent) {
1398+
function tokenizeThematicBreak(eat, value, silent) {
13991399
var self = this;
14001400
var index = -1;
14011401
var length = value.length + 1;
@@ -1434,7 +1434,7 @@ function tokenizeHorizontalRule(eat, value, silent) {
14341434
} else if (character === C_SPACE) {
14351435
queue += character;
14361436
} else if (
1437-
markerCount >= HORIZONTAL_RULE_MARKER_COUNT &&
1437+
markerCount >= THEMATIC_BREAK_MARKER_COUNT &&
14381438
(!character || character === C_NEWLINE)
14391439
) {
14401440
subvalue += queue;
@@ -1443,7 +1443,7 @@ function tokenizeHorizontalRule(eat, value, silent) {
14431443
return true;
14441444
}
14451445

1446-
return eat(subvalue)(self.renderVoid(T_HORIZONTAL_RULE));
1446+
return eat(subvalue)(self.renderVoid(T_THEMATIC_BREAK));
14471447
} else {
14481448
return;
14491449
}
@@ -1549,7 +1549,7 @@ function tokenizeBlockquote(eat, value, silent) {
15491549
tokenizers.fences.call(self, eat, rest, true) ||
15501550
tokenizers.heading.call(self, eat, rest, true) ||
15511551
tokenizers.lineHeading.call(self, eat, rest, true) ||
1552-
tokenizers.horizontalRule.call(self, eat, rest, true) ||
1552+
tokenizers.thematicBreak.call(self, eat, rest, true) ||
15531553
tokenizers.html.call(self, eat, rest, true) ||
15541554
tokenizers.list.call(self, eat, rest, true)
15551555
)
@@ -1820,7 +1820,7 @@ function tokenizeList(eat, value, silent) {
18201820

18211821
if (currentMarker && RULE_MARKERS[currentMarker] === true) {
18221822
if (
1823-
tokenizers.horizontalRule.call(self, eat, line, true)
1823+
tokenizers.thematicBreak.call(self, eat, line, true)
18241824
) {
18251825
break;
18261826
}
@@ -1863,7 +1863,7 @@ function tokenizeList(eat, value, silent) {
18631863

18641864
if (
18651865
!pedantic &&
1866-
tokenizers.horizontalRule.call(self, eat, line, true)
1866+
tokenizers.thematicBreak.call(self, eat, line, true)
18671867
) {
18681868
break;
18691869
}
@@ -3322,7 +3322,7 @@ function tokenizeParagraph(eat, value, silent) {
33223322
subvalue = value.slice(index + 1);
33233323

33243324
if (
3325-
tokenizers.horizontalRule.call(self, eat, subvalue, true) ||
3325+
tokenizers.thematicBreak.call(self, eat, subvalue, true) ||
33263326
tokenizers.heading.call(self, eat, subvalue, true) ||
33273327
tokenizers.fences.call(self, eat, subvalue, true) ||
33283328
tokenizers.blockquote.call(self, eat, subvalue, true) ||
@@ -3686,7 +3686,7 @@ function renderBlockquote(value, now) {
36863686
* Create a void node.
36873687
*
36883688
* @example
3689-
* renderVoid('horizontalRule');
3689+
* renderVoid('thematicBreak');
36903690
*
36913691
* @param {string} type - Node type.
36923692
* @return {Object} - Node of type `type`.
@@ -6080,7 +6080,7 @@ Parser.prototype.blockTokenizers = {
60806080
'fences': tokenizeFences,
60816081
'heading': tokenizeHeading,
60826082
'lineHeading': tokenizeLineHeading,
6083-
'horizontalRule': tokenizeHorizontalRule,
6083+
'thematicBreak': tokenizeThematicBreak,
60846084
'blockquote': tokenizeBlockquote,
60856085
'list': tokenizeList,
60866086
'html': tokenizeHTML,
@@ -6101,7 +6101,7 @@ Parser.prototype.blockMethods = [
61016101
'fences',
61026102
'blockquote',
61036103
'heading',
6104-
'horizontalRule',
6104+
'thematicBreak',
61056105
'list',
61066106
'lineHeading',
61076107
'html',

lib/stringify.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ LIST_BULLETS[PLUS] = true;
151151
* Allowed horizontal-rule bullet characters.
152152
*/
153153

154-
var HORIZONTAL_RULE_BULLETS = {};
154+
var THEMATIC_BREAK_BULLETS = {};
155155

156-
HORIZONTAL_RULE_BULLETS[ASTERISK] = true;
157-
HORIZONTAL_RULE_BULLETS[DASH] = true;
158-
HORIZONTAL_RULE_BULLETS[UNDERSCORE] = true;
156+
THEMATIC_BREAK_BULLETS[ASTERISK] = true;
157+
THEMATIC_BREAK_BULLETS[DASH] = true;
158+
THEMATIC_BREAK_BULLETS[UNDERSCORE] = true;
159159

160160
/*
161161
* Allowed emphasis characters.
@@ -752,7 +752,7 @@ compilerPrototype.options = defaultOptions;
752752
var maps = {
753753
'entities': ENTITY_OPTIONS,
754754
'bullet': LIST_BULLETS,
755-
'rule': HORIZONTAL_RULE_BULLETS,
755+
'rule': THEMATIC_BREAK_BULLETS,
756756
'listItemIndent': LIST_ITEM_INDENTS,
757757
'emphasis': EMPHASIS_MARKERS,
758758
'strong': EMPHASIS_MARKERS,
@@ -1564,14 +1564,14 @@ compilerPrototype.html = function (node) {
15641564
* @example
15651565
* var compiler = new Compiler();
15661566
*
1567-
* compiler.horizontalRule({
1568-
* type: 'horizontalRule'
1567+
* compiler.thematicBreak({
1568+
* type: 'thematicBreak'
15691569
* });
15701570
* // '***'
15711571
*
15721572
* @return {string} - Markdown rule.
15731573
*/
1574-
compilerPrototype.horizontalRule = function () {
1574+
compilerPrototype.thematicBreak = function () {
15751575
var options = this.options;
15761576
var rule = repeat(options.rule, options.ruleRepetition);
15771577

man/remarksetting.7

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Newlines in \fBLink\fR and \fBImage\fR titles;
210210
.IP \(bu 4
211211
White space in \fBLink\fR and \fBImage\fR URLs in auto-links (links in brackets, \fB<\fR and \fB>\fR);
212212
.IP \(bu 4
213-
Lazy \fBBlockquote\fR continuation\[em]lines not preceded by a closing angle bracket (\fB>\fR)\[em]for \fBList\fRs, \fBCode\fR, and \fBHorizontalRule\fR.
213+
Lazy \fBBlockquote\fR continuation\[em]lines not preceded by a closing angle bracket (\fB>\fR)\[em]for \fBList\fRs, \fBCode\fR, and \fBThematicBreak\fR.
214214
.RE 0
215215

216216
.P

script/setting/parse-commonmark/description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ The following constructs are not allowed:
2929
brackets, `<` and `>`);
3030

3131
* Lazy **Blockquote** continuation—lines not preceded by a closing angle
32-
bracket (`>`)—for **List**s, **Code**, and **HorizontalRule**.
32+
bracket (`>`)—for **List**s, **Code**, and **ThematicBreak**.

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ validateToken = function (context) {
998998
return;
999999
}
10001000

1001-
if (type === 'horizontalRule' || type === 'break') {
1001+
if (type === 'thematicBreak' || type === 'break') {
10021002
assert(keys === 1);
10031003

10041004
return;

test/tree/blockquote-lazy-rule.commonmark.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
}
5656
},
5757
{
58-
"type": "horizontalRule",
58+
"type": "thematicBreak",
5959
"position": {
6060
"start": {
6161
"line": 2,

test/tree/blockquote-lazy-rule.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
}
4141
},
4242
{
43-
"type": "horizontalRule",
43+
"type": "thematicBreak",
4444
"position": {
4545
"start": {
4646
"line": 2,

test/tree/def-blocks.commonmark.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
}
116116
},
117117
{
118-
"type": "horizontalRule",
118+
"type": "thematicBreak",
119119
"position": {
120120
"start": {
121121
"line": 4,

test/tree/def-blocks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
}
130130
},
131131
{
132-
"type": "horizontalRule",
132+
"type": "thematicBreak",
133133
"position": {
134134
"start": {
135135
"line": 4,

0 commit comments

Comments
 (0)