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

Escape urls, implement auto-prefixing and configurable link anchors #124

Merged
merged 18 commits into from
Oct 26, 2021

Conversation

cormacrelf
Copy link
Collaborator

@cormacrelf cormacrelf commented Oct 14, 2021

Fixes #123, fixes #116, fixes #115

  • add FormatOptions; refactor test suite to provide them
  • parse urls and render with %-encoding; roll our own html escaping
  • reimplement rtf escaping, to allow more memcpy
  • apply url escaping to rtf as well
  • replace InlineElement::Anchor with Link enum
  • add tests for csl 1.1 doi behaviour
  • remove InlineElement::Anchor
  • add to wasm api

Comment on lines +7 to +12
result: >-
{\field{\*\fldinst{HYPERLINK "https://google.com/?%E2%80%9D%C3%97%7B%7D%5C%7B%5Chello%7D"}}{\fldrslt https://google.com/?%E2%80%9D%C3%97\{\}\\\{\\hello\}}}

input:
- id: a
url: 'https://google.com/?”×{}\{\hello}'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Includes a test on hard mode 🦆

Comment on lines 283 to +288
let driverResult = Driver.new({
style: "<style version=\"1.0\" class=\"note\" ... > ... </style>",
format: "html", // optional, html is the default
formatOptions: { // optional
linkAnchors: true, // optional, default true
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how to turn it off via wasm api, for csl 1.0.2 compliance ✅

@cormacrelf cormacrelf added A-core Area: affects all builds of citeproc-rs A-crates/citeproc Area: citeproc crate A-wasm Area: wasm package on npm labels Oct 26, 2021
@cormacrelf cormacrelf merged commit 97be1ed into master Oct 26, 2021
@cormacrelf cormacrelf deleted the fix-url-escaping branch October 26, 2021 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: affects all builds of citeproc-rs A-crates/citeproc Area: citeproc crate A-wasm Area: wasm package on npm
1 participant