nushell-prophet / numd

numd - reproducible Nushell Markdown documents
The Unlicense
16 stars 0 forks source link

develop better heuristics for appending `| print` #52

Open maxim-uvarov opened 3 months ago

maxim-uvarov commented 3 months ago

The current everistics doesn't catch multiline string definitions

export def ends-with-definition [
    condition: string
]: nothing -> bool {
    $condition =~ '(;|null|(?>[^\r\n]*\b(let|def|use)\b.*[^\r\n;]*))$'
}
"let a = r#'\"High up in the mountains, a Snake crawled and lay in a damp gorge, coiled
    into a knot, staring out at the sea.'#" | ends-with-definition $in