import { Fragment, createElement } from 'react'; import { DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE, parse } from 'ultrahtml'; let ids = 0; export default function convert(children) { let doc = parse(children.toString().trim()); let id = ids++; let key = 0; function createReactElementFromNode(node) { const childVnodes = Array.isArray(node.children) && node.children.length ? node.children.map((child) => createReactElementFromNode(child)).filter(Boolean) : undefined; if (node.type === DOCUMENT_NODE) { return createElement(Fragment, {}, childVnodes); } else if (node.type === ELEMENT_NODE) { const { class: className, ...props } = node.attributes; return createElement(node.name, { ...props, className, key: `${id}-${key++}` }, childVnodes); } else if (node.type === TEXT_NODE) { // 0-length text gets omitted in JSX return node.value.trim() ? node.value : undefined; } } const root = createReactElementFromNode(doc); return root.props.children; } alue='dependabot/cargo/syn-2.0.44'>dependabot/cargo/syn-2.0.44 Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/book (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2019-10-23Fixed peripherals -> device typoGravatar Emil Fresk 1-2/+2
2019-10-21do not zero late resource memory on bootGravatar Jorge Aparicio 1-2/+10
2019-10-17version v0.5 is still betav0.5.0-beta.1Gravatar Jorge Aparicio 1-1/+1
2019-10-16ARMv7-M+Gravatar Jorge Aparicio 1-1/+1
2019-10-16add migration guideGravatar Jorge Aparicio 2-0/+226
2019-10-16Update book/en/src/by-example/timer-queue.mdGravatar Jorge Aparicio 1-1/+1
2019-10-15cyccnt::Instant: simplify the Send / Sync implGravatar Jorge Aparicio 1-13/+2
2019-10-15document the limitations of cyccnt::{Instant,Duration}Gravatar Jorge Aparicio 1-5/+19
2019-10-15more monotonic timer docsGravatar Jorge Aparicio 6-5/+33
2019-10-15v0.5.0 beta releaseGravatar Jorge Aparicio 7-27/+31
2019-10-11Fix matrix.to web link for the static room view.Gravatar Tim Small 1-1/+1
2019-10-10critical sections: each task gets its own contextGravatar chrysn 1-1/+1
2019-09-17fix linkchecker warningGravatar Jorge Aparicio 1-1/+1
2019-09-17fix more linksGravatar Jorge Aparicio 8-15/+15
2019-09-17update the CHANGELOGGravatar Jorge Aparicio 2-3/+38
2019-09-17www: fix book placementGravatar Jorge Aparicio 1-4/+3
2019-09-17www: prefix latest docs with the minor versionGravatar Jorge Aparicio 1-3/+6
2019-09-15remove reference from README to CONTRIBUTINGGravatar nils-grepit 1-1/+1
2019-09-15turn git deps into crates.io depsGravatar Jorge Aparicio 2-4/+2
2019-09-15add CONTRIBUTING.md and link to Matrix roomGravatar nils-grepit 2-0/+26
2019-09-15Revert "Fixed install script"Gravatar Emil Fresk 1-2/+2
2019-09-15Fixed install scriptGravatar Emil Fresk 1-2/+2
2019-09-15fix install scriptGravatar Jorge Aparicio 1-1/+1
2019-09-15Book fixGravatar Emil Fresk 1-1/+1
2019-09-150.4: don't cross compile docsGravatar Jorge Aparicio 1-0/+1
2019-09-15One more place updatedGravatar Emil Fresk 1-1/+1
2019-09-15faster doc builds and fix redirect on 0.4Gravatar Jorge Aparicio 2-12/+16
2019-09-15fix redirects and CNAMEGravatar Jorge Aparicio 2-4/+11
2019-09-15Updated links in README for rtfm.rsGravatar Emil Fresk 2-3/+3
2019-09-15link to older docs from the bookGravatar Jorge Aparicio 1-1/+4