From 47aca8914d3c7570a1ef628cbef8e2e0710ccebe Mon Sep 17 00:00:00 2001 From: Kelly Joseph Price Date: Wed, 4 Dec 2024 11:03:18 -0800 Subject: [PATCH] chore: remove old parser (#1034) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![PR App][icn]][demo] | Fix RM-9912 :-------------------:|:----------: ## 🧰 Changes Removes a now obsolete (and unused) parser. ## 🧬 QA & Testing - [Broken on production][prod]. - [Working in this PR app][demo]. [demo]: https://markdown-pr-PR_NUMBER.herokuapp.com [prod]: https://SUBDOMAIN.readme.io [icn]: https://user-images.githubusercontent.com/886627/160426047-1bee9488-305a-4145-bb2b-09d8b757d38a.svg --- processor/parse/reusable-content-parser.js | 36 ---------------------- 1 file changed, 36 deletions(-) delete mode 100644 processor/parse/reusable-content-parser.js diff --git a/processor/parse/reusable-content-parser.js b/processor/parse/reusable-content-parser.js deleted file mode 100644 index 271d86fa4..000000000 --- a/processor/parse/reusable-content-parser.js +++ /dev/null @@ -1,36 +0,0 @@ -const { insertBlockTokenizerBefore } = require('./utils'); - -export const type = 'reusable-content'; - -function tokenizeReusableContent(eat, value, silent) { - const { tags, disabled } = this.data('reusableContent'); - if (disabled) return false; - - // Modifies the regular expression to match from - // the start of the line - const match = /^<(?[A-Z]\S+)\s*\/>\s*/.exec(value); - - if (!match || !match.groups.tag) return false; - const { tag } = match.groups; - - /* istanbul ignore if */ - if (silent) return true; - - const node = { - type: 'reusable-content', - tag, - children: tag in tags ? tags[tag] : [], - }; - - return eat(match[0])(node); -} - -function parser() { - insertBlockTokenizerBefore.call(this, { - name: 'reusableContent', - before: 'html', - tokenizer: tokenizeReusableContent.bind(this), - }); -} - -export default parser;