diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b5773bc..a7687e1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -250,7 +250,7 @@ jobs: uses: addnab/docker-run-action@v3 with: image: ${{ steps.docker.outputs.IMAGE }} - options: "-v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }}" + options: "-v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} -e CI=true --platform ${{ steps.docker.outputs.PLATFORM }}" run: | if echo '${{ matrix.target }}' | grep -q '-musl$'; then apk add --no-cache openssl diff --git a/src/lib.rs b/src/lib.rs index 1da0a6e..e333ee6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -255,9 +255,7 @@ async fn markdown_to_typst_async( // "#link(label(\"{}\"))[{}]", current_link_url.replace("#", ""), current_link_text // )) // } else { - let result = &format!( - "#link(\"{current_link_url}\")[{current_link_text}] (`{current_link_url}`)" - ); + let result = &format!("#link(\"{current_link_url}\")[{current_link_text}];"); // Get the current output buffer based on context let current_output: &mut String = if in_code_block { &mut current_code_block @@ -1172,9 +1170,8 @@ print(f"User: {user}") assert!(result.is_ok()); let (typst_code, _) = result.unwrap(); - assert!(typst_code.contains( - "#link(\"https://www.rust-lang.org/\")[Rust] (`https://www.rust-lang.org/`)" - )); + assert!(typst_code.contains("#link(\"https://www.rust-lang.org/\")[Rust]")); + assert!(!typst_code.contains("(`https://www.rust-lang.org/`)")); } #[test] @@ -2156,7 +2153,7 @@ This is a new paragraph with underlined text."#; let (typst_code, _) = result.unwrap(); - assert!(typst_code.contains(r#"+ Third item with #link("http://test.com")[link with \*\*bold inside] (`http://test.com`) and \*italic not closed"#)); + assert!(typst_code.contains(r#"+ Third item with #link("http://test.com")[link with \*\*bold inside]; and \*italic not closed"#)); assert!(typst_code.contains( "+ Second item with #strong[markdown bold and #emph[HTML em]] but em not closed" ));