Support orcidlink badges
This commit is contained in:
1 parent
d9befd4d87
commit
da77f19d0f
3 files changed
+18
-1
No files matched your search
+1
-1
@@ -120,7 +120,7 @@ See `docs/ROADMAP.md` for concrete implementation plans.
|
|||||||
- ASCII-only documents use non-embedded Base-14 Times/Courier (arXiv PDF is
|
- ASCII-only documents use non-embedded Base-14 Times/Courier (arXiv PDF is
|
||||||
about 0.7 MB); documents with accented/non-WinAnsi text embed Liberation
|
about 0.7 MB); documents with accented/non-WinAnsi text embed Liberation
|
||||||
faces. Tables use natural column widths and centered rules.
|
faces. Tables use natural column widths and centered rules.
|
||||||
- `cargo fmt --check` passes; `cargo test --offline` (52 tests: 48 compiler
|
- `cargo fmt --check` passes; `cargo test --offline` (53 tests: 49 compiler
|
||||||
integration tests + 4 server tests) covers the three examples, the arXiv
|
integration tests + 4 server tests) covers the three examples, the arXiv
|
||||||
fixture, figure/table floats (top and bottom), newpage, page styles and `\thispagestyle`, SVG/PDF output,
|
fixture, figure/table floats (top and bottom), newpage, page styles and `\thispagestyle`, SVG/PDF output,
|
||||||
project API, static frontend assets, path traversal, the legacy
|
project API, static frontend assets, path traversal, the legacy
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ const PRELUDE: &str = r#"
|
|||||||
\def\caption#1{\texrracaptionstart#1\texrracaptionend}
|
\def\caption#1{\texrracaptionstart#1\texrracaptionend}
|
||||||
\def\href#1#2{\texrrahref{#1}{#2}}
|
\def\href#1#2{\texrrahref{#1}{#2}}
|
||||||
\def\texrraorcibadge{iD\ }
|
\def\texrraorcibadge{iD\ }
|
||||||
|
\def\orcidlink#1{\href{https://orcid.org/#1}{\texrraorcibadge}}
|
||||||
\def\hline{\texrratablerule}
|
\def\hline{\texrratablerule}
|
||||||
\def\toprule{\texrratablerule}
|
\def\toprule{\texrratablerule}
|
||||||
\def\midrule{\texrratablerule}
|
\def\midrule{\texrratablerule}
|
||||||
|
|||||||
@@ -1484,6 +1484,22 @@ See \href{https://example.com}{the example site} for details.
|
|||||||
assert!(svg.contains(">example</text>"), "{svg}");
|
assert!(svg.contains(">example</text>"), "{svg}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn orcidlink_renders_a_green_badge_without_printing_the_url() {
|
||||||
|
let source = r"\documentclass{article}
|
||||||
|
\begin{document}
|
||||||
|
\orcidlink{0000-0002-1825-0097}
|
||||||
|
\end{document}";
|
||||||
|
let value = fresh_preview(source, "orcidlink.tex");
|
||||||
|
assert_eq!(value["status"], "ok", "{value}");
|
||||||
|
let svg = page_svg(&value, 0);
|
||||||
|
assert!(svg.contains("fill=\"#008000\">iD</text>"), "{svg}");
|
||||||
|
assert!(
|
||||||
|
!svg.contains("orcid.org"),
|
||||||
|
"URL leaked into the document: {svg}"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn caption_footnotes_follow_the_figure_page() {
|
fn caption_footnotes_follow_the_figure_page() {
|
||||||
let source = r"\documentclass{article}
|
let source = r"\documentclass{article}
|
||||||
|
|||||||
Reference in new issue
Block a user