mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
19 lines
712 B
TypeScript
19 lines
712 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import type { Element } from 'domhandler'
|
|
import type { NodeReplacement } from '../../replace-components/component-replacer'
|
|
import { ComponentReplacer, DO_NOT_REPLACE } from '../../replace-components/component-replacer'
|
|
import { LinemarkerMarkdownExtension } from './linemarker-markdown-extension'
|
|
|
|
/**
|
|
* Detects line markers and suppresses them in the resulting DOM.
|
|
*/
|
|
export class LinemarkerReplacer extends ComponentReplacer {
|
|
public replace(codeNode: Element): NodeReplacement {
|
|
return codeNode.name === LinemarkerMarkdownExtension.tagName ? null : DO_NOT_REPLACE
|
|
}
|
|
}
|