Skip to content

Commit f0c365d

Browse files
authored
strip LTM and RTM entities when normalize text
To support bidirectional text alphabetization (https://en.wikipedia.org/wiki/Bidirectional_text) Via EbookFoundation/free-programming-books#6714
1 parent ee5f968 commit f0c365d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: lib/alphabetical-list-items.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ const visit = require('unist-util-visit');
33
const toString = require('mdast-util-to-string');
44

55
function normalize(text) {
6-
const removeAtBeginning = /^([-._("'])*/;
7-
const removeInside = /[,:]/;
6+
const removeAtBeginning = /^([-._("'\u200e\u200f])*/;
7+
const removeInside = /[,:\u200e\u200f]/;
88
const replaceWithSpace = /-/;
99
return text.toLowerCase()
1010
.trim()

0 commit comments

Comments
 (0)