mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Update MD018/no-missing-space-atx to ignore Keycap Number Sign emoji at start of line (fixes #257).
This commit is contained in:
parent
67d1476ed8
commit
b87094e33d
2 changed files with 27 additions and 1 deletions
|
@ -11,7 +11,10 @@ module.exports = {
|
|||
"tags": [ "headings", "headers", "atx", "spaces" ],
|
||||
"function": function MD018(params, onError) {
|
||||
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
|
||||
if (!inCode && /^#+[^#\s]/.test(line) && !/#\s*$/.test(line)) {
|
||||
if (!inCode &&
|
||||
/^#+[^#\s]/.test(line) &&
|
||||
!/#\s*$/.test(line) &&
|
||||
!line.startsWith("#️⃣")) {
|
||||
const hashCount = /^#+/.exec(line)[0].length;
|
||||
addErrorContext(
|
||||
onError,
|
||||
|
|
23
test/emoji-headings.md
Normal file
23
test/emoji-headings.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Emoji Headings
|
||||
|
||||
#️⃣ Keycap Number Sign
|
||||
|
||||
<https://emojipedia.org/keycap-number-sign/>
|
||||
|
||||
# #️⃣ Keycap Number Sign
|
||||
|
||||
Text
|
||||
|
||||
##️⃣ Keycap Number Sign {MD018}
|
||||
|
||||
Text
|
||||
|
||||
# Keycap Number Sign #️⃣
|
||||
|
||||
Text
|
||||
|
||||
# Keycap Number Sign#️⃣
|
||||
|
||||
Text
|
||||
|
||||
<!-- markdownlint-disable-file MD025 -->
|
Loading…
Add table
Add a link
Reference in a new issue