the editable site (validation-lab)
This commit is contained in:
commit
3ac81d5a52
13454 files changed
+2227005
No files matched your search
+27
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @import {Parents} from 'hast'
|
||||
* @import {Raw} from 'mdast-util-to-hast'
|
||||
* @import {State} from '../index.js'
|
||||
*/
|
||||
|
||||
import {text} from './text.js'
|
||||
|
||||
/**
|
||||
* Serialize a raw node.
|
||||
*
|
||||
* @param {Raw} node
|
||||
* Node to handle.
|
||||
* @param {number | undefined} index
|
||||
* Index of `node` in `parent`.
|
||||
* @param {Parents | undefined} parent
|
||||
* Parent of `node`.
|
||||
* @param {State} state
|
||||
* Info passed around about the current state.
|
||||
* @returns {string}
|
||||
* Serialized node.
|
||||
*/
|
||||
export function raw(node, index, parent, state) {
|
||||
return state.settings.allowDangerousHtml
|
||||
? node.value
|
||||
: text(node, index, parent, state)
|
||||
}
|
||||
Reference in new issue
Block a user