mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 11:01:56 +02:00
Merge pull request #12805 from overleaf/ae-markdown-types
[cm6] Fix type for Markdown language loader GitOrigin-RevId: 725e1b28dd73e9090638f5d682e48e658c957a04
This commit is contained in:
@@ -53,7 +53,6 @@ export const languages = [
|
||||
LanguageDescription.of({
|
||||
name: 'markdown',
|
||||
extensions: ['md', 'markdown'],
|
||||
// @ts-ignore TODO: find out how to add support extensions
|
||||
load: () => {
|
||||
return import('./markdown').then(m => m.markdown())
|
||||
},
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
import { markdown as markdownLanguage } from '@codemirror/lang-markdown'
|
||||
import { shortcuts } from './shortcuts'
|
||||
import { languages } from '../index'
|
||||
import { Extension } from '@codemirror/state'
|
||||
import { Strikethrough } from '@lezer/markdown'
|
||||
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language'
|
||||
import {
|
||||
HighlightStyle,
|
||||
LanguageSupport,
|
||||
syntaxHighlighting,
|
||||
} from '@codemirror/language'
|
||||
import { tags } from '@lezer/highlight'
|
||||
|
||||
export const markdown = (): Extension => {
|
||||
return [
|
||||
markdownLanguage({
|
||||
codeLanguages: languages,
|
||||
extensions: [Strikethrough],
|
||||
}),
|
||||
export const markdown = () => {
|
||||
const { language, support } = markdownLanguage({
|
||||
codeLanguages: languages,
|
||||
extensions: [Strikethrough],
|
||||
})
|
||||
|
||||
return new LanguageSupport(language, [
|
||||
support,
|
||||
shortcuts(),
|
||||
syntaxHighlighting(markdownHighlightStyle),
|
||||
]
|
||||
])
|
||||
}
|
||||
|
||||
const markdownHighlightStyle = HighlightStyle.define([
|
||||
|
||||
Reference in New Issue
Block a user