aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/autolink.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-13 14:50:48 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-13 14:56:28 +0200
commit4277dac07db06f24ba30a75b4c1dec542e32dae8 (patch)
treebcad7ace156eecf64fd8d0fb03a4b091bac2f845 /src/construct/autolink.rs
parentefdf90959f78d1582da312bffbefaabb79f264b7 (diff)
downloadmarkdown-rs-4277dac07db06f24ba30a75b4c1dec542e32dae8.tar.gz
markdown-rs-4277dac07db06f24ba30a75b4c1dec542e32dae8.tar.bz2
markdown-rs-4277dac07db06f24ba30a75b4c1dec542e32dae8.zip
Add support for sanitizing urls
* Add support for properly encoding characters in urls * Add support for sanitizing potentially dangerous urls * Add safe defaults, optionally live dangerously
Diffstat (limited to 'src/construct/autolink.rs')
-rw-r--r--src/construct/autolink.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/construct/autolink.rs b/src/construct/autolink.rs
index 24f2c20..c190d40 100644
--- a/src/construct/autolink.rs
+++ b/src/construct/autolink.rs
@@ -41,12 +41,12 @@
//! Interestingly, there are a couple of things that are valid autolinks in
//! markdown but in HTML would be valid tags, such as `<svg:rect>` and
//! `<xml:lang/>`.
-//! However, because CommonMark employs a naïve HTML parsing algorithm, those
+//! However, because `CommonMark` employs a naïve HTML parsing algorithm, those
//! are not considered HTML.
//!
-//! While CommonMark restricts links from occurring in other links in the case
-//! of bracketed links, this restriction is not in place for autolinks inside
-//! autolinks:
+//! While `CommonMark` restricts links from occurring in other links in the
+//! case of bracketed links, this restriction is not in place for autolinks
+//! inside autolinks:
//!
//! ```markdown
//! [<https://example.com>](#)
@@ -74,8 +74,6 @@
//! [autolink_scheme_size_max]: crate::constant::AUTOLINK_SCHEME_SIZE_MAX
//! [autolink_domain_size_max]: crate::constant::AUTOLINK_DOMAIN_SIZE_MAX
//! [html-a]: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element
-//!
-//! <!-- To do: link to `encode` -->
use crate::constant::{AUTOLINK_DOMAIN_SIZE_MAX, AUTOLINK_SCHEME_SIZE_MAX};
use crate::tokenizer::{Code, State, StateFnResult, TokenType, Tokenizer};