Update MD018/no-missing-space-atx to ignore Keycap Number Sign emoji at start of line (fixes #257).

This commit is contained in:
David Anson 2020-03-08 19:49:52 -07:00
parent 67d1476ed8
commit b87094e33d
2 changed files with 27 additions and 1 deletions

View file

@ -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,