More text with outdated stuff.
`;
-export const parentConfig: NodeConfig = {
+export const parentConfig: TagConfig = {
children: [],
content: 0,
invalid: [],
@@ -107,126 +98,79 @@ export const parentConfig: NodeConfig = {
...TAGS.div,
};
-export function matchCodeTag(
- string: string,
- tag: string,
-): MatchResponse<{
- children: string;
- customProp: string;
-}> | null {
- const matches = string.match(new RegExp(`\\[${tag}\\]`));
-
- if (!matches) {
- return null;
- }
-
- return {
- children: tag,
- customProp: 'foo',
- index: matches.index!,
- length: matches[0].length,
- match: matches[0],
- valid: true,
- void: false,
- };
-}
-
-export class CodeTagMatcher extends Matcher<{}> {
- tag: string;
-
- key: string;
-
- constructor(tag: string, key: string = '') {
- super(tag, {});
-
- this.tag = tag;
- this.key = key;
- }
-
- replaceWith(match: ChildrenNode, props: { children?: string; key?: string } = {}): Node {
- const { children } = props;
-
- if (this.key) {
- // eslint-disable-next-line
- props.key = this.key;
- }
-
- return (
-