tobijk / caius

A functional testing framework in object-oriented Tcl
MIT License
26 stars 5 forks source link

Markdown: undefined refs #10

Closed wduquette closed 9 years ago

wduquette commented 9 years ago

Undefined references in Markdown input cause a runtime error in markdown.tcl: it looks for the reference in ::Markdown::_references and can't find it. For example, try this:

Unknown ref: [foo]

I updated "parse_inline" as follows:

                    if {[info exists references_($ref)]} {
                        lassign $references_($ref) url title

                        set url [HtmlEscape [string trim $url {<> }]]
                        set txt [ParseInline $txt]
                        set title [ParseInline $title]

                        set match_found 1
                    } else {
                        # Unknown ref: just put in the matching text.
                        append result $m
                        continue
                    }

For "references_", read "Markdown::_references".

tobijk commented 9 years ago

Many thanks. Added in 5baac223.