aboutsummaryrefslogtreecommitdiffstats
path: root/src/constant.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-15 12:17:36 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-15 12:36:33 +0200
commit21dbf42b5e5979fb30837bbb3b2638dcf5711249 (patch)
tree103151dc1bff63b64e9c83735f1ca6a560b4397b /src/constant.rs
parent8e025d192743b2cdc2d9313d9074dc42630c811f (diff)
downloadmarkdown-rs-21dbf42b5e5979fb30837bbb3b2638dcf5711249.tar.gz
markdown-rs-21dbf42b5e5979fb30837bbb3b2638dcf5711249.tar.bz2
markdown-rs-21dbf42b5e5979fb30837bbb3b2638dcf5711249.zip
Add docs on `LIST_ITEM_VALUE_SIZE_MAX`
Diffstat (limited to 'src/constant.rs')
-rw-r--r--src/constant.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/constant.rs b/src/constant.rs
index 5dd2435..2c74083 100644
--- a/src/constant.rs
+++ b/src/constant.rs
@@ -67,7 +67,7 @@ pub const CHARACTER_REFERENCE_NAMED_SIZE_MAX: usize = 31;
/// [code_fenced]: crate::construct::code_fenced
pub const CODE_FENCED_SEQUENCE_SIZE_MIN: usize = 3;
-/// The number of spaces needed, before a line ending, for a [hard break
+/// The number of preceding spaces needed for a [hard break
/// (trailing)][hard_break_trailing] to form.
///
/// [hard_break_trailing]: crate::construct::hard_break_trailing
@@ -193,8 +193,18 @@ pub const HTML_RAW_SIZE_MAX: usize = 8;
/// To safeguard performance, labels are capped at a large number: `999`.
pub const LINK_REFERENCE_SIZE_MAX: usize = 999;
-/// To do.
-/// See: <https://spec.commonmark.org/0.30/#ordered-list-marker>
+
+/// The max number of decimals allowed to form an (ordered) [list][] item.
+///
+/// `CommonMark` caps this at 10 digits (9 is fine, 10 not).
+/// This limit is imposed because bigger numbers result in integer overflows
+/// in some browsers.
+///
+/// ## References
+///
+/// * [*ยง 5.2 List items* in `CommonMark`](https://spec.commonmark.org/0.30/#ordered-list-marker)
+///
+/// [list]: crate::construct::list
pub const LIST_ITEM_VALUE_SIZE_MAX: usize = 10;
/// Maximum allowed unbalanced parens in destination.