~/bend-docscommunity

protect.bend checks

raw source on the hub · import 0xf40d06f265422706966baaec48c3e5f2/protect.bend as Protect

Markdown protect regions — port of bible-linkify protect.ts (pure Bend) Length of protected span at suffix start, or 0n. Phase-carried Bools only.

1 import
import Base

Types

type FmPh source · line 55 · raw

Data

--- Frontmatter ---

type FsPh source · line 198 · raw

Data

--- Fence ---

type FnGate source · line 395 · raw

Data

type IcPh source · line 436 · raw

Data

--- Inline code ---

type IcGate source · line 523 · raw

Data

type WkPh source · line 543 · raw

Data

--- Wikilink ---

type WkGate source · line 610 · raw

Data

type MdPh source · line 626 · raw

Data

--- Markdown link ---

type MdGate source · line 727 · raw

Data

type HtPh source · line 784 · raw

Data

--- HTML ---

type PkPh source · line 881 · raw

Data

--- Priority pick ---

type FpGate source · line 936 · raw

Data

Definitions

def char1 source · line 5 · raw

@+c:Char -> String

def str_drop_go source · line 8 · raw

@fuel:Nat -> @n:Nat -> @s:String -> String

def str_drop source · line 23 · raw

@+n:Nat -> @+s:String -> String

def str_take_go source · line 26 · raw

@fuel:Nat -> @n:Nat -> @s:String -> @acc:String -> String

def str_take source · line 41 · raw

@+n:Nat -> @+s:String -> String

def is_newline source · line 44 · raw

@+c:Char -> Bool

def is_hyphen source · line 49 · raw

@+c:Char -> Bool

def pick_dash1_nl source · line 70 · raw

@nl:Bool -> FmPh

def pick_dash1 source · line 77 · raw

@is_dash:Bool -> @nl:Bool -> FmPh

def frontmatter_go source · line 85 · raw

@fuel:Nat -> @ph:FmPh -> @+rest:String -> @+consumed:Nat -> Nat

def frontmatter_len_if source · line 182 · raw

@ok:Bool -> @+s:String -> Nat

def frontmatter_len source · line 194 · raw

@+s:String -> Nat

def is_tick_char source · line 210 · raw

@+want_tick:Bool -> @+c:Char -> Bool

def fence_len_go source · line 217 · raw

@fuel:Nat -> @ph:FsPh -> @rest:String -> Nat

def fence_len_from_open source · line 388 · raw

@+want_tick:Bool -> @+s:String -> Nat

def fence_len_gate source · line 401 · raw

@fuel:Nat -> @g:FnGate -> @+s:String -> Nat

def fence_len source · line 428 · raw

@+at_bol:Bool -> @+s:String -> Nat

def inline_code_go source · line 444 · raw

@fuel:Nat -> @ph:IcPh -> @rest:String -> Nat

def inline_code_len_gated source · line 526 · raw

@g:IcGate -> @+s:String -> Nat

def inline_code_len source · line 535 · raw

@+s:String -> Nat

def html_go source · line 794 · raw

@fuel:Nat -> @ph:HtPh -> @rest:String -> Nat

def html_len source · line 877 · raw

@+s:String -> Nat

def protect_len_go source · line 892 · raw

@fuel:Nat -> @ph:PkPh -> @+at_bol:Bool -> @+s:String -> Nat

def protect_len source · line 933 · raw

@+at_bol:Bool -> @+s:String -> Nat

def pick_nonzero_go source · line 940 · raw

@+a:Nat -> @+b:Nat -> @z:Bool -> Nat

def pick_nonzero source · line 947 · raw

@+a:Nat -> @+b:Nat -> Nat

def frontmatter_or_protect source · line 950 · raw

@+at_doc_start:Bool -> @+at_bol:Bool -> @+s:String -> Nat