zola icon indicating copy to clipboard operation
zola copied to clipboard

panic: `failed to parse line: UnresolvedContextReference(ByScope { scope: <source.shell> })`

Open jyn514 opened this issue 8 months ago • 3 comments

Bug Report

Environment

Zola version: 0.20.0

Expected Behavior

zola should have parsed the .sublime-syntax file correctly.

Current Behavior

zola panics:

Building site...

thread '<unnamed>' panicked at components/markdown/src/codeblock/highlight.rs:62:64:
failed to parse line: UnresolvedContextReference(ByScope { scope: <source.shell>, sub_context: None, with_escape: true })
backtrace
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result<T,E>::expect
   4: markdown::codeblock::highlight::ClassHighlighter::highlight_line
   5: markdown::codeblock::highlight::SyntaxHighlighter::highlight_line
   6: markdown::codeblock::CodeBlock::highlight
   7: markdown::markdown::markdown_to_html
   8: markdown::render_content
   9: content::page::Page::render_markdown
  10: site::Site::render_markdown::{{closure}}
  11: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &F>::call_mut
  12: core::iter::adapters::map::map_try_fold::{{closure}}
  13: core::iter::traits::iterator::Iterator::try_fold
  14: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
  15: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
  16: <core::iter::adapters::take_while::TakeWhile<I,P> as core::iter::traits::iterator::Iterator>::try_fold
  17: <core::iter::adapters::take_while::TakeWhile<I,P> as core::iter::traits::iterator::Iterator>::fold
  18: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  19: core::iter::traits::iterator::Iterator::for_each
  20: <rayon::iter::noop::NoopConsumer as rayon::iter::plumbing::Folder<T>>::consume_iter
  21: <rayon::iter::while_some::WhileSomeFolder<C> as rayon::iter::plumbing::Folder<core::option::Option<T>>>::consume_iter
  22: <rayon::iter::map::MapFolder<C,F> as rayon::iter::plumbing::Folder<T>>::consume_iter
  23: <rayon::iter::map::MapFolder<C,F> as rayon::iter::plumbing::Folder<T>>::consume_iter
  24: rayon::iter::plumbing::Producer::fold_with
  25: rayon::iter::plumbing::bridge_producer_consumer::helper
  26: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
  27: rayon_core::join::join_context::call_a::{{closure}}
  28: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  29: std::panicking::try::do_call
  30: __rust_try
  31: std::panic::catch_unwind
  32: rayon_core::unwind::halt_unwinding
  33: rayon_core::join::join_context::{{closure}}
  34: rayon_core::registry::in_worker
  35: rayon_core::join::join_context
  36: rayon::iter::plumbing::bridge_producer_consumer::helper
  37: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
  38: rayon_core::join::join_context::call_b::{{closure}}
  39: rayon_core::job::JobResult<T>::call::{{closure}}
  40: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  41: std::panicking::try::do_call
  42: __rust_try
  43: std::panic::catch_unwind
  44: rayon_core::unwind::halt_unwinding
  45: rayon_core::job::JobResult<T>::call
  46: <rayon_core::job::StackJob<L,F,R> as rayon_core::job::Job>::execute
  47: rayon_core::job::JobRef::execute
  48: rayon_core::registry::WorkerThread::execute
  49: rayon_core::registry::WorkerThread::wait_until_cold
  50: rayon_core::registry::WorkerThread::wait_until
  51: rayon_core::registry::WorkerThread::wait_until_out_of_work
  52: rayon_core::registry::main_loop
  53: rayon_core::registry::ThreadBuilder::run
  54: <rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

i am not sure why this doesn't work. i see various packages in https://github.com/search?q=repo%3Asublimehq%2FPackages+embed%3A+source.shell&type=code that are using embed: scope:source.shell without issues.

Step to reproduce

  • Add markdown.extra_syntaxes_and_themes = ["./syntax"] to config.toml
  • mkdir syntax && cd syntax
  • git clone https://github.com/michaelblyons/SublimeSyntax-Crontab
  • zola serve

jyn514 avatar Feb 22 '25 22:02 jyn514