mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00
Adjust editor config (#976)
* Adjust editor config Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
0180c75e55
commit
e12dc523f8
301 changed files with 4393 additions and 3741 deletions
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import MarkdownIt from 'markdown-it'
|
||||
import abbreviation from 'markdown-it-abbr'
|
||||
|
@ -22,7 +22,7 @@ import { twitterEmojis } from '../markdown-it-plugins/twitter-emojis'
|
|||
import { MarkdownItConfigurator } from './MarkdownItConfigurator'
|
||||
|
||||
export class BasicMarkdownItConfigurator extends MarkdownItConfigurator {
|
||||
protected configure (markdownIt: MarkdownIt): void {
|
||||
protected configure(markdownIt: MarkdownIt): void {
|
||||
this.configurations.push(
|
||||
twitterEmojis,
|
||||
abbreviation,
|
||||
|
|
|
@ -24,7 +24,7 @@ import { YoutubeReplacer } from '../replace-components/youtube/youtube-replacer'
|
|||
import { BasicMarkdownItConfigurator } from './BasicMarkdownItConfigurator'
|
||||
|
||||
export class FullMarkdownItConfigurator extends BasicMarkdownItConfigurator {
|
||||
constructor (
|
||||
constructor(
|
||||
private useFrontmatter: boolean,
|
||||
private passYamlErrorState: (error: boolean) => void,
|
||||
private onRawMeta: (rawMeta: RawNoteFrontmatter) => void,
|
||||
|
@ -34,7 +34,7 @@ export class FullMarkdownItConfigurator extends BasicMarkdownItConfigurator {
|
|||
super()
|
||||
}
|
||||
|
||||
protected configure (markdownIt: MarkdownIt): void {
|
||||
protected configure(markdownIt: MarkdownIt): void {
|
||||
super.configure(markdownIt)
|
||||
|
||||
this.configurations.push(
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import MarkdownIt from 'markdown-it'
|
||||
|
||||
export abstract class MarkdownItConfigurator {
|
||||
protected configurations:MarkdownIt.PluginSimple[] = [];
|
||||
protected postConfigurations:MarkdownIt.PluginSimple[] = [];
|
||||
protected configurations: MarkdownIt.PluginSimple[] = []
|
||||
protected postConfigurations: MarkdownIt.PluginSimple[] = []
|
||||
|
||||
protected abstract configure(markdownIt: MarkdownIt): void;
|
||||
|
||||
public pushConfig (plugin: MarkdownIt.PluginSimple): this {
|
||||
public pushConfig(plugin: MarkdownIt.PluginSimple): this {
|
||||
this.configurations.push(plugin)
|
||||
return this
|
||||
}
|
||||
|
||||
public buildConfiguredMarkdownIt (): MarkdownIt {
|
||||
public buildConfiguredMarkdownIt(): MarkdownIt {
|
||||
const markdownIt = new MarkdownIt('default', {
|
||||
html: true,
|
||||
breaks: true,
|
||||
|
@ -29,4 +27,6 @@ export abstract class MarkdownItConfigurator {
|
|||
this.postConfigurations.forEach((postConfiguration) => markdownIt.use(postConfiguration))
|
||||
return markdownIt
|
||||
}
|
||||
|
||||
protected abstract configure(markdownIt: MarkdownIt): void;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue