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/Utils.ml.html
Source file Utils.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
let is_empty_line = let re = Str.regexp "[ \t]*$" in fun line -> Str.string_match re line 0 let re_spaces_upto_four = Str.regexp " \\| \\| \\| " let read_classes = let re_space = Str.regexp "[ \t]+" in let re_class = Str.regexp "\\.\\(.+\\)" in fun s -> String.trim s |> Str.split re_space |> List.filter_map (fun class_ -> if Str.string_match re_class class_ 0 then Some (Str.matched_group 1 class_) else None) let remove_trailing_chars cond s = let len = String.length s in let exception Done of string in try for i = len - 1 downto 0 do if not (cond s.[i]) then raise (Done (String.sub s 0 (i + 1))) done; "" with Done s -> s let remove_trailing_spaces s = remove_trailing_chars (fun c -> c = ' ' || c = '\t') s let remove_trailing_sharps s = remove_trailing_chars (fun c -> c = '#') s
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>