diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c416721..ad7cd32 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,5 @@ name: Precomp NIFs -env: - NIF_DIRECTORY: "native/comrak_nif" - on: push: branches: @@ -71,7 +68,7 @@ jobs: - name: Build the project id: build-crate - uses: philss/rustler-precompiled-action@v1.0.1 + uses: philss/rustler-precompiled-action@v1.1.0 with: project-name: comrak_nif project-version: ${{ env.PROJECT_VERSION }} diff --git a/native/comrak_nif/src/inkjet_adapter.rs b/native/comrak_nif/src/inkjet_adapter.rs index d87a723..c43a527 100644 --- a/native/comrak_nif/src/inkjet_adapter.rs +++ b/native/comrak_nif/src/inkjet_adapter.rs @@ -44,9 +44,11 @@ impl<'a> SyntaxHighlighterAdapter for InkjetAdapter<'a> { None => None, }, ) + // TODO: fallback to plain text .expect("expected to generate the syntax highlight events"); for event in highlights { + // TODO: fallback to plain text let event = event.expect("expected a highlight event"); let inner_highlights = autumn::inner_highlights(source, event, self.theme); write!(output, "{}", inner_highlights)? diff --git a/native/comrak_nif/vendor/autumn/src/lib.rs b/native/comrak_nif/vendor/autumn/src/lib.rs index 570e55f..354b396 100644 --- a/native/comrak_nif/vendor/autumn/src/lib.rs +++ b/native/comrak_nif/vendor/autumn/src/lib.rs @@ -25,6 +25,7 @@ pub fn highlight_source_code( None => None, }, ) + // TODO: fallback to plain text .expect("expected to generate the syntax highlight events"); output.push_str( @@ -37,6 +38,7 @@ pub fn highlight_source_code( ); for event in highlights { + // TODO: fallback to plain text let event = event.expect("expected a highlight event"); let highlight = inner_highlights(source, event, theme); output.push_str(highlight.as_str()) @@ -97,7 +99,8 @@ pub fn inner_highlights(source: &str, event: HighlightEvent, theme: &Theme) -> S HighlightEvent::Source { start, end } => { let span = source .get(start..end) - .expect("Source bounds should be in bounds!"); + // TODO: fallback to plain text + .expect("source bounds should be in bounds!"); let span = v_htmlescape::escape(span).to_string(); output.push_str(span.as_str()) }