package kkmarkdown
A safe markdown engine
Install
Dune Dependency
Authors
Maintainers
Sources
1.1.0.tar.gz
md5=a20517d95590d03ff5b7670323b8b0dd
sha512=97b3faa09e23ab88c5b4dcabe88f29e5c675b6bb4b0c9230ec105a70b01b37b54274cc0ab4a5eed84a754a99e3664e116a7aba6c9697e3669229985f1bf749be
doc/src/kkmarkdown.lib/SpanRuleStack.ml.html
Source file SpanRuleStack.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
module Make (M : sig val first_chars : char list val re : Str.regexp val stack_elt : Typ.stack_elt end) = struct let is_safe = true let first_char = FirstChar.OneOf M.first_chars let construct _ ({ SpanRule.s; cur; stack } as state) : Typ.span option = if Str.string_match M.re s cur then ( state.cur <- Str.match_end (); Some (match stack with | stack_elt :: tl when stack_elt = M.stack_elt -> state.stack <- tl; StackClose M.stack_elt | _ -> state.stack <- M.stack_elt :: stack; StackOpen M.stack_elt)) else None end module Em = Make (struct let first_chars = [ '*'; '_' ] let re = Str.regexp "\\*\\|_" let stack_elt = Typ.Em end) module Strong = Make (struct let first_chars = [ '*'; '_' ] let re = Str.regexp "\\*\\*\\|__" let stack_elt = Typ.Strong end) module EmStrong = Make (struct let first_chars = [ '*'; '_' ] let re = Str.regexp "\\*\\*\\*\\|___" let stack_elt = Typ.EmStrong end) module Strike = Make (struct let first_chars = [ '~' ] let re = Str.regexp "~~" let stack_elt = Typ.Strike end) module Code = Make (struct let first_chars = [ '`' ] let re = Str.regexp "`" let stack_elt = Typ.Code end)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>