1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859(** Used internally, no need to use *)(* https://github.com/facebook/react/blob/97d75c9c8bcddb0daed1ed062101c7f5e9b825f4/packages/react-dom-bindings/src/shared/omittedCloseTags.js *)letis_self_closing_tag=function|"area"|"base"|"br"|"col"|"embed"|"hr"|"img"|"input"|"link"|"meta"|"param"|"source"|"track"|"wbr"|"menuitem"->true|_->false(* Based on https://github.com/facebook/react/blob/97d75c9c8bcddb0daed1ed062101c7f5e9b825f4/packages/react-dom-bindings/src/server/escapeTextForBrowser.js#L51-L98 *)(* https://discuss.ocaml.org/t/html-encoding-of-string/4289/4 *)letencodes=letbuffer=Buffer.create(String.lengths*2)ins|>String.iter(function|'&'->Buffer.add_stringbuffer"&"|'<'->Buffer.add_stringbuffer"<"|'>'->Buffer.add_stringbuffer">"|'"'->Buffer.add_stringbuffer"""|'\''->Buffer.add_stringbuffer"'"|c->Buffer.add_charbufferc);Buffer.contentsbufferletis_html_elementtag=matchtagwith|"a"|"abbr"|"address"|"area"|"article"|"aside"|"audio"|"b"|"base"|"bdi"|"bdo"|"blockquote"|"body"|"br"|"button"|"canvas"|"caption"|"cite"|"code"|"col"|"colgroup"|"data"|"datalist"|"dd"|"del"|"details"|"dfn"|"dialog"|"div"|"dl"|"dt"|"em"|"embed"|"fieldset"|"figcaption"|"figure"|"footer"|"form"|"h1"|"h2"|"h3"|"h4"|"h5"|"h6"|"head"|"header"|"hgroup"|"hr"|"html"|"i"|"iframe"|"img"|"input"|"ins"|"kbd"|"label"|"legend"|"li"|"link"|"main"|"map"|"mark"|"math"|"menu"|"menuitem"|"meta"|"meter"|"nav"|"noscript"|"object"|"ol"|"optgroup"|"option"|"output"|"p"|"param"|"picture"|"pre"|"progress"|"q"|"rb"|"rp"|"rt"|"rtc"|"ruby"|"s"|"samp"|"script"|"search"|"section"|"select"|"slot"|"small"|"source"|"span"|"strong"|"style"|"sub"|"summary"|"sup"|"svg"|"table"|"tbody"|"td"|"template"|"textarea"|"tfoot"|"th"|"thead"|"time"|"title"|"tr"|"track"|"u"|"ul"|"var"|"video"|"wbr"->true|_->falseletis_svg_elementtag=matchtagwith|"animate"|"animateMotion"|"animateTransform"|"circle"|"clipPath"|"defs"|"desc"|"ellipse"|"feBlend"|"feColorMatrix"|"feComponentTransfer"|"feComposite"|"feConvolveMatrix"|"feDiffuseLighting"|"feDisplacementMap"|"feDistantLight"|"feDropShadow"|"feFlood"|"feFuncA"|"feFuncB"|"feFuncG"|"feFuncR"|"feGaussianBlur"|"feImage"|"feMerge"|"feMergeNode"|"feMorphology"|"feOffset"|"fePointLight"|"feSpecularLighting"|"feSpotLight"|"feTile"|"feTurbulence"|"filter"|"foreignObject"|"g"|"image"|"line"|"linearGradient"|"marker"|"mask"|"metadata"|"mpath"|"path"|"pattern"|"polygon"|"polyline"|"radialGradient"|"rect"|"stop"|"switch"|"symbol"|"text"|"textPath"|"tspan"|"use"|"view"->true|_->false