diff --git a/.travis.yml b/.travis.yml index 4505b7d..5404431 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,7 @@ jobs: julia: 1 os: linux script: - - julia --project=doc/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); - Pkg.instantiate()' + - julia --project=doc/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - julia --project=doc/ doc/make.jl after_success: skip diff --git a/doc/src/usage.md b/doc/src/usage.md index 8b663aa..dcff8a0 100644 --- a/doc/src/usage.md +++ b/doc/src/usage.md @@ -148,7 +148,7 @@ Weave will remove the first empty space from each line of documentation. ## Configuration via YAML Header -When `weave`ing markdown files, you use YAML header to provide additional metadata and configuration options. +When `weave`ing markdown files, you can use YAML header to provide additional metadata and configuration options. See [Header Configuration](@ref) section for more details. diff --git a/src/reader/markdown.jl b/src/reader/markdown.jl index 4620abd..6a462b3 100644 --- a/src/reader/markdown.jl +++ b/src/reader/markdown.jl @@ -22,7 +22,12 @@ function separate_header_text(text) m = match(HEADER_REGEX, text) isnothing(m) && return "", text, 0 header_text = m[:header] - return header_text, replace(text, HEADER_REGEX => ""; count = 1), count("\n", header_text) + offset = @static if VERSION ≥ v"1.4" + count("\n", header_text) + else + count(c->c==='\n', header_text) + end + return header_text, replace(text, HEADER_REGEX => ""; count = 1), offset end # HACK: