I’m trying to define a Prosemirror schema to deal with a TEI Document edition:
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>Doc title</title>
<author>Joh Doe</author>
</titleStmt>
<publicationStmt>
<distributor>M. XY</distributor>
</publicationStmt>
</fileDesc>
</teiHeader>
<text>
<body type="main">
<head type="level-1">TEI Editor Test - Title Level 1</head>
<p>
<seg>This text is</seg>
<hi>important</hi>
<seg>and ...</seg>
</p>
<p>
<seg>A seg in a paragraph.</seg>
</p>
</body>
</text>
</TEI>
I am not able to parse head
tag with that config :
[...]
heading: {
attrs: {type: {default: "level-1"}},
content: "inline*",
group: "block",
parseDOM: [
{tag: "head", attrs: {type: "level-1"}}],
toDOM: function toDOM(node) {
return ["h" + node.attrs.type.split('-')[1], 0]
}
},
[...]
The same rule works fine when I replace head
with hea
for example (both in the xml source and the parseDOM’s tag value).
How can I handle it ? Thank you.