~/bend-docscommunity

linkify.bend checks

raw source on the hub · import 0x7ac3d173083047725064b6e6915eb3cb/linkify.bend as Linkify

bible-linkify surface (pure Bend): protect-aware Markdown walker + plain matcher

4 imports
import Base
import ./route.bend as Route
import ./protect.bend as Prot
import ./parse.bend as P

Types

type TvPh source · line 17 · raw

Data

Peek trailing " (ESV)" after a match — does not consume; code or "".

type SigPh source · line 199 · raw

Data

--- Passage signal ---

type TrPh source · line 237 · raw

Data

--- Trim wrappers: drop lead wrappers, reverse, drop lead (ex-trail), reverse ---

type TcPh source · line 285 · raw

Data

type VisCan source · line 377 · raw

Data

type CandGate source · line 380 · raw

Data

type TwPh source · line 416 · raw

Data

type ExPh source · line 453 · raw

Data

--- Urlish ---

type NaPh source · line 530 · raw

Data

type PlPh source · line 564 · raw

Data

--- Plain linkify ---

type LpGate source · line 761 · raw

Data

type FullHit2 source · line 764 · raw

Data

type MdWalk source · line 827 · raw

Data

--- Markdown walker ---

Definitions

def char1 source · line 7 · raw

@+c:Char -> String

def linkify_parts source · line 10 · raw

@+visible:String -> @+canonical:String -> String

def linkify_parts_qv source · line 13 · raw

@+visible:String -> @+canonical:String -> @+translation:String -> String

def tv_letter_ok source · line 29 · raw

@+letters:Nat -> Bool

def tv_digit_ok source · line 32 · raw

@+digits:Nat -> Bool

def peek_translation_go source · line 35 · raw

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

def peek_translation source · line 138 · raw

@+suffix:String -> String

def is_newline source · line 145 · raw

@+c:Char -> Bool

def is_alnum source · line 150 · raw

@+c:Char -> Bool

def is_wrapper_lead source · line 153 · raw

@+c:Char -> Bool

def is_wrapper_trail source · line 168 · raw

@+c:Char -> Bool

def has_signal_go source · line 203 · raw

@fuel:Nat -> @ph:SigPh -> @rest:String -> Bool

def has_passage_signal source · line 233 · raw

@+s:String -> Bool

def is_wrapper_either source · line 241 · raw

@+c:Char -> Bool

def trim_pass_go source · line 244 · raw

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

def trim_pass source · line 267 · raw

@+s:String -> String

def trim_wrappers source · line 270 · raw

@+s:String -> String

def is_colon_dot_dash source · line 274 · raw

@+c:Char -> Bool

--- Candidate take ---

def is_cand_char source · line 279 · raw

@+c:Char -> Bool

def pick_sp source · line 296 · raw

@has_d:Bool -> @+n:Nat -> TcPh

def take_cand_go source · line 303 · raw

@fuel:Nat -> @ph:TcPh -> @+rest:String -> @acc:String -> String

def take_candidate source · line 373 · raw

@+s:String -> String

def cand_pick source · line 384 · raw

@empty:Bool -> @+visible:String -> @+canonical:String -> CandGate

def cand_from source · line 391 · raw

@+visible:String -> @+canonical:String -> CandGate

def try_parse_visible_gated source · line 394 · raw

@g:CandGate -> Maybe<&2, VisCan>

def try_parse_visible source · line 401 · raw

@+visible:String -> Maybe<&2, VisCan>

def drop_last_rev source · line 406 · raw

@rev:String -> String

def drop_last source · line 413 · raw

@s:String -> String

def try_windows_go source · line 422 · raw

@fuel:Nat -> @ph:TwPh -> Maybe<&2, VisCan>

def try_windows source · line 449 · raw

@+raw:String -> Maybe<&2, VisCan>

def expand_token_left source · line 457 · raw

@fuel:Nat -> @ph:ExPh -> @+left_rev:String -> @acc:String -> String

def expand_token_right source · line 480 · raw

@fuel:Nat -> @ph:ExPh -> @+right:String -> @acc:String -> String

def token_around source · line 503 · raw

@+prefix_rev:String -> @+matched:String -> @+suffix:String -> String

def is_urlish_token source · line 512 · raw

@+tok:String -> Bool

def is_book_num source · line 521 · raw

@+c:Char -> Bool

def looks_like_ref_start source · line 527 · raw

@+c:Char -> Bool

def not_alnum_next_go source · line 533 · raw

@ph:NaPh -> Bool

def not_alnum_next source · line 542 · raw

@next_suffix:String -> Bool

def standalone_from_prev source · line 549 · raw

@prev_alnum:Bool -> @+next_suffix:String -> Bool

def standalone_ok source · line 556 · raw

@+prev_rev:String -> @+next_suffix:String -> Bool

def pick_pl_ref source · line 577 · raw

@at_start:Bool -> PlPh

def pick_pl source · line 584 · raw

@is_ref:Bool -> @at_start:Bool -> PlPh

def linkify_plain_go source · line 602 · raw

@fuel:Nat -> @ph:PlPh -> @+rest:String -> @+prev_rev:String -> @out:String -> String

def classify_rest source · line 769 · raw

@exact:Bool -> @+visible:String -> @+canonical:String -> @+rest:String -> FullHit2

def classify_hit source · line 776 · raw

@m:Maybe<&2, VisCan> -> @+text:String -> FullHit2

def linkify_plain_from_hit source · line 790 · raw

@h:FullHit2 -> @+text:String -> String

def linkify_plain_gated source · line 814 · raw

@g:LpGate -> @+text:String -> String

def linkify_plain source · line 823 · raw

@+text:String -> String

def linkify_md_go source · line 835 · raw

@fuel:Nat -> @ph:MdWalk -> @+rest:String -> @plain:String -> @out:String -> String

def linkify_markdown source · line 918 · raw

@+source:String -> String