mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
chore(ckeditor5/plugins): integrate remove format links
This commit is contained in:
parent
2dcd37001f
commit
bf45720f21
@ -1,7 +0,0 @@
|
||||
// A simple plugin that extends the remove format feature to consider links.
|
||||
export default function removeFormatLinksPlugin( editor ) {
|
||||
// Extend the editor schema and mark the "linkHref" model attribute as formatting.
|
||||
editor.model.schema.setAttributeProperties( 'linkHref', {
|
||||
isFormatting: true
|
||||
} );
|
||||
}
|
@ -6,6 +6,7 @@ import ItalicAsEmPlugin from "./plugins/italic_as_em.js";
|
||||
import StrikethroughAsDel from "./plugins/strikethrough_as_del.js";
|
||||
import InternalLinkPlugin from "./plugins/internallink.js";
|
||||
import ReferenceLink from "./plugins/referencelink.js";
|
||||
import RemoveFormatLinksPlugin from "./plugins/remove_format_links.js";
|
||||
|
||||
const TRILIUM_PLUGINS: typeof Plugin[] = [
|
||||
CutToNotePlugin,
|
||||
@ -13,7 +14,8 @@ const TRILIUM_PLUGINS: typeof Plugin[] = [
|
||||
StrikethroughAsDel,
|
||||
ReferenceLink,
|
||||
UploadimagePlugin,
|
||||
InternalLinkPlugin
|
||||
InternalLinkPlugin,
|
||||
RemoveFormatLinksPlugin
|
||||
];
|
||||
|
||||
export const COMMON_PLUGINS: typeof Plugin[] = [
|
||||
@ -74,7 +76,6 @@ export const COMMON_PLUGINS: typeof Plugin[] = [
|
||||
// MentionCustomization,
|
||||
// IncludeNote,
|
||||
// indentBlockShortcutPlugin,
|
||||
// removeFormatLinksPlugin,
|
||||
PageBreak,
|
||||
GeneralHtmlSupport,
|
||||
TextPartLanguage,
|
||||
|
19
packages/ckeditor5/src/plugins/remove_format_links.ts
Normal file
19
packages/ckeditor5/src/plugins/remove_format_links.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { Plugin, RemoveFormat } from "ckeditor5";
|
||||
|
||||
/**
|
||||
* A simple plugin that extends the remove format feature to consider links.
|
||||
*/
|
||||
export default class RemoveFormatLinksPlugin extends Plugin {
|
||||
|
||||
static get requires() {
|
||||
return [ RemoveFormat ]
|
||||
}
|
||||
|
||||
init() {
|
||||
// Extend the editor schema and mark the "linkHref" model attribute as formatting.
|
||||
this.editor.model.schema.setAttributeProperties( 'linkHref', {
|
||||
isFormatting: true
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user