1// @tiptap/[email protected] downloaded from https://ga.jspm.io/npm:@tiptap/[email protected]/dist/index.js 2 3import{Node as e,nodeInputRule as t,canInsertNode as o,isNodeSelection as n,mergeAttributes as r}from"@tiptap/core";import{TextSelection as s,NodeSelection as a}from"@tiptap/pm/state";var i=e.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",r(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!o(t,t.schema.nodes[this.name]))return false;const{selection:r}=t;const{$to:i}=r;const c=e();n(r)?c.insertContentAt(i.pos,{type:this.name}):c.insertContent({type:this.name});return c.command((({state:e,tr:t,dispatch:o})=>{if(o){const{$to:o}=t.selection;const n=o.end();if(o.nodeAfter)o.nodeAfter.isTextblock?t.setSelection(s.create(t.doc,o.pos+1)):o.nodeAfter.isBlock?t.setSelection(a.create(t.doc,o.pos)):t.setSelection(s.create(t.doc,o.pos));else{const r=e.schema.nodes[this.options.nextNodeType]||o.parent.type.contentMatch.defaultType;const a=r==null?void 0:r.create();if(a){t.insert(n,a);t.setSelection(s.create(t.doc,n+1))}}t.scrollIntoView()}return true})).run()}}},addInputRules(){return[t({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
3ype})]}});var c=i;export{i as HorizontalRule,c as default}; 4
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.