Skip to content

Commit

Permalink
fix(HTML & JATS): Use Mark.type instead of type map
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Jun 18, 2021
1 parent ffc83fc commit 712d2f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/codecs/html/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { getLogger } from '@stencila/logga'
import stencila, {
isA,
isInlineContent,
markTypes,
microdata,
microdataItemtype,
microdataProperty,
Expand Down Expand Up @@ -2357,9 +2356,9 @@ function encodeThematicBreak(): HTMLHRElement {
/**
* Decode an inline element e.g `<em>` to a `Mark` node e.g. `Emphasis`.
*/
function decodeMark<Type extends keyof typeof markTypes>(
function decodeMark(
elem: HTMLElement,
type: Type
type: stencila.Mark['type']
): stencila.Mark {
return { type, content: decodeInlineChildNodes(elem) }
}
Expand Down
4 changes: 2 additions & 2 deletions src/codecs/jats/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1792,10 +1792,10 @@ function populateBibrContent(rid: string, state: EncodeState): void {
* Deocde a JATS `<italic>`, `<bold>` etc node as a Stencila `Mark` node
* of `Type` e.g. `Strong`.
*/
function decodeMark<Type extends keyof typeof stencila.markTypes>(
function decodeMark(
elem: xml.Element,
state: DecodeState,
type: Type
type: stencila.Mark['type']
): stencila.Mark[] {
return [
{
Expand Down

0 comments on commit 712d2f5

Please sign in to comment.