Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using python3 as the language of a multiline codeblock results in an error #1074

Open
Seelengrab opened this issue Jan 20, 2024 · 3 comments

Comments

@Seelengrab
Copy link
Contributor

The codeblock:

    ```python3
 
    foo
    ```

The error:

→ Initial full pass...
┌ Franklin Warning: in <index.md>
│ Encountered an issue processing 'index.md' in <article>
│ Verify, then re-start the Franklin server.
│ The error is displayed below:
│ ErrorException("type Nothing has no field captures")
└
ERROR: type Nothing has no field captures
Stacktrace:
  [1] getproperty(x::Nothing, f::Symbol)
    @ Base ./Base.jl:37
  [2] parse_fenced_block(ss::SubString{String}, scut::Bool; shortcut::Bool, repl::Bool, shell::Bool, pkg::Bool, help::Bool)
    @ Franklin ~/.julia/packages/Franklin/R3VpM/src/eval/codeblock.jl:29
[...]

I've omitted the rest of the stacktrace, since the issue seems to be located in that function. I think the regex chosen here (CODE_3_PAT) just doesn't take the 3 into account.

@tlienart
Copy link
Owner

tlienart commented Feb 5, 2024

Thanks @Seelengrab I can adjust the regex; note: if you just use python is the syntax highlighting incorrect?

@Seelengrab
Copy link
Contributor Author

I'm almost positive that it's correct, but I must admit, once it looked half-way decent I didn't actually check 🤔 Here's the case I was looking at, which seems to render correctly:

image

The HTML source code also only says python, so I guess it depends on what highlight.js does with that.

@Seelengrab
Copy link
Contributor Author

I've encountered the same problem when using c++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants