package kkmarkdown

  1. Overview
  2. Docs
A safe markdown engine

Install

Dune Dependency

Authors

Maintainers

Sources

1.0.0.tar.gz
md5=cc8056af18a204bf68d60f50be5a9de7
sha512=452ef12429aa68606e79b82d883275abd05659fec52509dfa18d7de0edcfa0afba7fa9001d9643c5ad072a494ad8593c6f127e382b06d6c224964b3a7969f388

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
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)
OCaml

Innovation. Community. Security.