commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
c68a656032d1ead987638a7d5eacf146a3fa4872 | Evgeny Safronov | 2015-03-15T19:29:41 | [CC] Refactoring. | diff --git a/src/lib.rs b/src/lib.rs
index 0c22750..916c29f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -146,10 +146,12 @@ pub fn read_bool<R>(rd: &mut R) -> Result<bool>
pub fn read_positive_fixnum_exact<R>(rd: &mut R) -> Result<u8>
where R: Read
{
- match read_marker(rd) {
- Ok(Marker::Fixnum(val)) =... | 1 | 6 | 4 |
227772d20fe8aa0e6c2cfb2586434fac6e3fa25e | Evgeny Safronov | 2015-03-15T19:29:32 | [Dev] Decoding negative fixnum. | diff --git a/src/lib.rs b/src/lib.rs
index f5c02b7..0c22750 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -16,6 +16,7 @@ const FIXSTR_SIZE : u8 = 0x1f;
enum Marker {
Fixnum(u8),
+ NegativeFixnum(i8),
Null,
True,
False,
@@ -37,6 +38,7 @@ impl FromPrimitive for Marker {
fn from_u64(n: u64) ->... | 1 | 35 | 0 |
033f0afff3106cc1b87f8ca02d3ba16c7d6ce6c4 | Evgeny Safronov | 2015-03-15T19:16:31 | [Dev] String buffer error handling. | diff --git a/src/lib.rs b/src/lib.rs
index 3b22d10..f5c02b7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -96,6 +96,7 @@ pub enum Error {
InvalidMarker(MarkerError), // Marker type error.
InvalidMarkerRead(ReadError), // IO error while reading marker.
InvalidDataRead(ReadError), // IO error while... | 1 | 15 | 10 |
af64752f42db8e7b0b833565485320f27b7be09e | Evgeny Safronov | 2015-03-15T18:56:28 | [UT] Code clean. | diff --git a/src/lib.rs b/src/lib.rs
index 1f92168..3b22d10 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -589,7 +589,7 @@ fn from_str_fixstr_borrow() {
let out = read_str_ref(&buf).unwrap();
assert_eq!(10, out.len());
- assert!([0x6c, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65] == out[0..10]);
+... | 1 | 1 | 1 |
4ed29b07a240aa79897e9938bf92487a90401e10 | Evgeny Safronov | 2015-03-15T18:56:18 | [Dev] The variable doesn't need to be mut. | diff --git a/src/lib.rs b/src/lib.rs
index 31f0036..1f92168 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -584,7 +584,7 @@ fn from_str_fixstr() {
#[test]
fn from_str_fixstr_borrow() {
- let mut buf: &mut [u8] = &mut [0xaa, 0x6c, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65];
+ let buf: &[u8] = &[0xaa, 0... | 1 | 1 | 1 |
fe41d562b5bcca1340cc11072fc0f70a13c34045 | Evgeny Safronov | 2015-03-15T18:55:56 | [Dev] Minor renaming. | diff --git a/src/lib.rs b/src/lib.rs
index 4653b8e..31f0036 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -238,7 +238,7 @@ pub fn read_str<R>(rd: &mut R, mut buf: &mut [u8]) -> Result<u32>
}
/// Tries to read a string data from the reader and make a borrowed slice from it.
-pub fn read_str_borrow(rd: &[u8]) -> Result... | 1 | 2 | 2 |
855007b805f00528042721b0b0de88dae8653ddc | Evgeny Safronov | 2015-03-15T09:46:37 | [Dev] Decode from string with optional borrowing. | diff --git a/src/lib.rs b/src/lib.rs
index 55d9033..4653b8e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -222,11 +222,34 @@ pub fn read_str_len<R>(rd: &mut R) -> Result<u32>
///
/// According to the spec, the string's data must to be encoded using UTF-8.
/// Returns number of bytes actually read.
-//pub fn read_str_d... | 1 | 49 | 13 |
0931368837899c99437216c63de0e4617ec07850 | Evgeny Safronov | 2015-03-14T13:28:52 | [Dev] Unpacking all string sizes. | diff --git a/src/lib.rs b/src/lib.rs
index 26dffd5..55d9033 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -25,6 +25,8 @@ enum Marker {
U64,
FixedString(u8),
Str8,
+ Str16,
+ Str32,
}
impl FromPrimitive for Marker {
@@ -44,6 +46,8 @@ impl FromPrimitive for Marker {
0xce => Some(Marker... | 1 | 135 | 8 |
4402be80f5abec1bfec52604c8cfde3c47dd13e2 | Evgeny Safronov | 2015-03-14T12:42:27 | [Dev] Unpacking unsigned integers from the reader. | diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..f8c36cc
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,20 @@
+[root]
+name = "msgpack"
+version = "0.1.0"
+dependencies = [
+ "byteorder 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "bswap"
+version = "0.1.... | 3 | 460 | 0 |
aba929c5068f69de5ae2e92b397fd901922f2c0d | Sebastian Thiel | 2025-12-23T03:58:08 | refactor
- adjust doc-string links and phrasing. | diff --git a/src/lib.rs b/src/lib.rs
index 32c2cd4..def7c86 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -248,12 +248,13 @@ pub struct Options<'a> {
pub emphasis_token: char,
/// The string to use for strong emphasis (bold)
pub strong_token: &'a str,
- /// Whether or not to use HTML tags `<sup>` and `<... | 1 | 7 | 6 |
ffa22b3e25ef79aad66774f1c08b1a4a1b1bc4f4 | Daniel Silverstone | 2025-12-21T21:40:02 | feat!: Add support for super/subscript without html
Superscript and subscript can be presented in markdown as:
^superscript^ and ~subscript~ respectively. This is not always turned on,
and many people prefer the HTML tag form, however in order to round-trip
markdown which uses the symbolic form we need an option to en... | diff --git a/src/lib.rs b/src/lib.rs
index 986adf2..32c2cd4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -248,6 +248,13 @@ pub struct Options<'a> {
pub emphasis_token: char,
/// The string to use for strong emphasis (bold)
pub strong_token: &'a str,
+ /// Whether or not to use HTML tags `<sup>` and `<s... | 1 | 28 | 4 |
6d09f445a72555fbd70812b21a38ba65bba0e42b | Sebastian Thiel | 2025-12-22T10:10:17 | refactor | diff --git a/src/lib.rs b/src/lib.rs
index 2c0a420..986adf2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,7 +1,6 @@
-//! Convert pulldown-cmark `Event`s back to the string they were parsed from.
+//! Convert `pulldown-cmark` `Event`s back to the string they were parsed from.
//!
-//! This crate provides functions to ... | 1 | 7 | 7 |
942c42ba6fc517b595130603e9fd4aa1309ee755 | Connor Gray | 2025-02-18T19:58:08 | refactor: Add Repeated utility to simplify writing repeated content | diff --git a/src/lib.rs b/src/lib.rs
index c561ce8..baf9558 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,9 +7,7 @@ use std::{
ops::Range,
};
-use pulldown_cmark::{
- Alignment as TableAlignment, BlockQuoteKind, Event, HeadingLevel, LinkType, MetadataBlockKind, Tag, TagEnd,
-};
+use pulldown_cmark::{Alignme... | 2 | 30 | 28 |
5b93e7e7b51000632bfecf6d7a49e48d9fb3bc19 | Connor Gray | 2025-02-20T12:47:42 | review: Drop comment headers | diff --git a/src/lib.rs b/src/lib.rs
index 13a59a6..c561ce8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -251,10 +251,6 @@ impl From<fmt::Error> for Error {
}
}
-//======================================
-// Public API Functions
-//======================================
-
/// As [`cmark_with_options()`], but wit... | 2 | 0 | 24 |
30b706b719fd2554b664bc7d2c40bcb7e7095a8c | Connor Gray | 2025-02-18T19:24:29 | refactor: Move and group related code
My impression reading through the code in this project is that
top-level statements have gotten a bit intertangled over time;
this tries to reorder things to have a clearer flow and
structure, grouping related things together.
For example, this moves the recently added Error enum... | diff --git a/src/lib.rs b/src/lib.rs
index 4ec3859..13a59a6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,7 +3,7 @@
use std::{
borrow::{Borrow, Cow},
collections::HashSet,
- fmt::{self, Write},
+ fmt,
ops::Range,
};
@@ -94,12 +94,6 @@ pub struct State<'a> {
pub last_event_end_index: usize... | 2 | 236 | 210 |
31a49d0d45c1c32bfcf1c653121ee3ca0a1d4fe8 | Connor Gray | 2025-02-17T06:29:02 | refactor: Add State::set_minimum_newlines_before_start()
This should help with readability. As an example, I didn't realize
initially that all of the `if` statements updated in this PR
were actually modifying the same field.
But once I started doing the more generic refactoring of adding
a `set_option_minimum()` meth... | diff --git a/src/lib.rs b/src/lib.rs
index 17ec269..026f30f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -320,9 +320,7 @@ where
let res = match event.borrow() {
Rule => {
consume_newlines(formatter, state)?;
- if state.newlines_before_start < options.newlines_after_rule {
- ... | 1 | 25 | 43 |
3ab278b9db5546f405bcd13bdf5c3f0d59d2fb8a | Connor Gray | 2025-02-17T05:07:55 | refactor: Use `write_padded_string()` in a couple additional places
Additionally, while in the neighhborhood, add `pub(crate)` to the other
text_modifications.rs private helpers
These being marked as `pub` is misleading since the `text_modifications`
module is not actually externally public, and these functions
are n... | diff --git a/src/lib.rs b/src/lib.rs
index 17ec269..a9133cd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -868,15 +868,12 @@ where
}
}
state.last_was_text_without_trailing_newline = !text.ends_with('\n');
- print_text_without_trailing_newline(
- &escape... | 2 | 10 | 15 |
ed16be5ad4d32d3d17a5ac86a60f7e0a2cbf2c91 | Sebastian Thiel | 2025-02-18T06:51:03 | bump version to 21 for pulldown-cmark 13 | diff --git a/Cargo.toml b/Cargo.toml
index 533d8d9..dc79940 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "pulldown-cmark-to-cmark"
-version = "20.0.1"
+version = "21.0.0"
authors = [
"Sebastian Thiel <byronimo@gmail.com>",
"Dylan Owen <dyltotheo@gmail.com>", | 1 | 1 | 1 |
e10010f198a9cba9c0691def19978cf444740aa2 | Sebastian Thiel | 2025-02-18T06:44:17 | Update doc-string so `State::padding` is shown conventionally | diff --git a/src/text_modifications.rs b/src/text_modifications.rs
index 84a2d5d..4b57c28 100644
--- a/src/text_modifications.rs
+++ b/src/text_modifications.rs
@@ -68,7 +68,7 @@ pub fn padding_of(l: Option<u64>) -> Cow<'static, str> {
}
}
-/// Write a newline followed by the current [`State.padding`][State::pa... | 1 | 1 | 1 |
05e247e5c7a74ac7bf9a906417724b8a275cabcc | Connor Gray | 2025-02-17T07:27:09 | fixup: Adjust wording + typos | diff --git a/src/text_modifications.rs b/src/text_modifications.rs
index c59e0b6..84a2d5d 100644
--- a/src/text_modifications.rs
+++ b/src/text_modifications.rs
@@ -73,7 +73,7 @@ pub fn padding_of(l: Option<u64>) -> Cow<'static, str> {
///
/// [`write_padded_newline()`] takes care of writing both a newline character,... | 1 | 3 | 3 |
2252ba1d9cf93256a8bcdd721813ed2397e32464 | Connor Gray | 2025-02-17T02:11:32 | refactor: Add helper to factor out newline + padding pattern
When writing a newline into the generated Markdown content
to start a new line of output, it is (almost) always necessary
to output the "padding" characters used to indent the content
at the current location in the document, based on the hierarchy
of block-l... | diff --git a/src/lib.rs b/src/lib.rs
index 74ae6c0..02d0cc3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -540,7 +540,7 @@ where
// level in our blockquote. This should work regardless if we have other
// padding or if we're in a list
if !consumed_newlines {
... | 2 | 45 | 18 |
abb85a61515b1e9ccb9f40fb6f15b409f9d4602e | Sebastian Thiel | 2025-02-12T06:48:46 | thanks clippy | diff --git a/src/lib.rs b/src/lib.rs
index 856cb90..74ae6c0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -205,13 +205,13 @@ const DEFAULT_OPTIONS: Options<'_> = Options {
strong_token: "**",
};
-impl<'a> Default for Options<'a> {
+impl Default for Options<'_> {
fn default() -> Self {
DEFAULT_OPTION... | 1 | 3 | 3 |
27cbc1635ca77acae37fe4723daf75dd1c8733a0 | Andrew Lyjak | 2025-02-10T21:33:12 | fix: definition list block indentation now works correctly (#97). | diff --git a/Cargo.toml b/Cargo.toml
index 15440a7..4b39afb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,7 +5,8 @@ authors = [
"Sebastian Thiel <byronimo@gmail.com>",
"Dylan Owen <dyltotheo@gmail.com>",
"Alessandro Ogier <alessandro.ogier@gmail.com>",
- "Zixian Cai <2891235+caizixian@users.noreply.g... | 2 | 26 | 5 |
60e185422a15f3d5e33e889e9874bfb44ff25833 | Michael Sloan | 2025-01-15T18:23:02 | Add comments explaining inline code escaping | diff --git a/src/lib.rs b/src/lib.rs
index e2ee647..0578a14 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -351,9 +351,13 @@ where
Cow::Borrowed(text.as_ref())
};
+ // When inline code has leading and trailing ' ' characters, additional space is needed
+ // to escape i... | 1 | 4 | 0 |
32628b3562225a8bec3e7a9ed54467dad5d7c2ef | Michael Sloan | 2025-01-15T18:07:21 | Improve naming in function for counting max consecutive chars | diff --git a/src/lib.rs b/src/lib.rs
index afb315c..e2ee647 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -354,7 +354,7 @@ where
if text.chars().all(|ch| ch == ' ') {
write!(formatter, "`{text}`")
} else {
- let backticks = "`".repeat(count_consecutive(&text, '`')... | 1 | 20 | 16 |
4766cc1c4dc569841e89068d3292b28d3c57e2e6 | Andrea Ciprietti | 2024-12-14T17:05:15 | Add integration test for CmarkError::UnexpectedEvent | diff --git a/tests/integrate/main.rs b/tests/integrate/main.rs
index c4fe0fd..3052d4c 100644
--- a/tests/integrate/main.rs
+++ b/tests/integrate/main.rs
@@ -2,6 +2,37 @@ mod display;
mod fmt;
mod spec;
+#[cfg(test)]
+mod fuzzed {
+ use pulldown_cmark::{Event, HeadingLevel, Tag, TagEnd};
+ use pulldown_cmark_t... | 1 | 31 | 0 |
fdc5859ff9823189c6966d5448468bff1d82d899 | Andrea Ciprietti | 2024-12-14T19:33:29 | fix!: Add structured error handling for cmark(), cmark_resume() etc
When `cmark_resume_with_options()`, which serves as basis for the other
`cmark*` functions, finds an inconsistent event stream (for example, two
consecutive heading start tags), it panics.
Introduce a custom error type `Error` in the crate and change... | diff --git a/src/lib.rs b/src/lib.rs
index 1f43f29..afb315c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -246,13 +246,16 @@ impl<'a> Options<'a> {
///
/// *Returns* the [`State`] of the serialization on success. You can use it as initial state in the
/// next call if you are halting event serialization.
-/// *Errors*... | 3 | 73 | 35 |
a442910b6e82f17f0e044ceb2069dd4bd76ffa34 | Andrea Ciprietti | 2024-12-14T11:37:22 | Revert "fix: harden again manufactured input which could previously trigger assertion failures. (#91)"
This reverts commit a368f0f4ddbfeb8728abf92feaf0d4ed0e81b858. | diff --git a/src/lib.rs b/src/lib.rs
index 75e6d3b..1f43f29 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -470,6 +470,7 @@ where
classes,
attrs,
} => {
+ assert_eq!(state.current_heading, None);
state.current_heading = Some... | 2 | 25 | 60 |
a368f0f4ddbfeb8728abf92feaf0d4ed0e81b858 | Sebastian Thiel | 2024-12-11T06:35:27 | fix: harden again manufactured input which could previously trigger assertion failures. (#91) | diff --git a/src/lib.rs b/src/lib.rs
index 1f43f29..75e6d3b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -470,7 +470,6 @@ where
classes,
attrs,
} => {
- assert_eq!(state.current_heading, None);
state.current_heading = Some... | 2 | 60 | 25 |
b526d7cf0ad6df2ce8278a5fd634afb2067c484e | Sebastian Thiel | 2024-12-11T06:37:04 | refactor tests | diff --git a/tests/display.rs b/tests/integrate/display.rs
similarity index 100%
rename from tests/display.rs
rename to tests/integrate/display.rs
diff --git a/tests/fmt.rs b/tests/integrate/fmt.rs
similarity index 92%
rename from tests/fmt.rs
rename to tests/integrate/fmt.rs
index 63718c7..920a5da 100644
--- a/tests/f... | 5 | 82 | 73 |
022fa11e3a39c6b6bc0b2dcd9728bf205f00d5d1 | Chris Krycho | 2024-11-21T15:40:55 | Use `Cow<'a, str>` to minimize allocations for pipe escaping | diff --git a/src/lib.rs b/src/lib.rs
index 949fe9b..1f43f29 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -318,10 +318,11 @@ where
// in inline code in a table. Other escaping is handled when `Text`
// events are emitted.
let text = if state.in_table_cell {
- text.rep... | 1 | 3 | 2 |
c9ecdd24024c0807ceb424f9dfae3b1b22072336 | Chris Krycho | 2024-11-21T15:31:25 | Correct comment/note on when pipe characters are/not escaped | diff --git a/src/lib.rs b/src/lib.rs
index 4c8c6b6..949fe9b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -310,15 +310,13 @@ where
}
// (re)-escape `|` when it appears as part of inline code in the
- // body of a table. NOTES:
- // - This is always *safe*, but may not be ... | 1 | 7 | 9 |
13785fe11cc8851f6f939b1763ae99d655a2d5dc | Chris Krycho | 2024-11-21T15:27:45 | feat!: Make `State` struct non-exhaustive
That way, future additions to the rather internal state won't be a reason for breaking changes anymore. | diff --git a/src/lib.rs b/src/lib.rs
index 47e0d65..4c8c6b6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -51,6 +51,7 @@ pub enum CodeBlockKind {
/// This does not only allow introspection, but enables the user
/// to halt the serialization at any time, and resume it later.
#[derive(Clone, Default, Debug, PartialEq, E... | 2 | 221 | 463 |
37e8dcbf9af753542c39bd077d62e6799fac1f83 | Chris Krycho | 2024-11-20T20:49:22 | Escape special characters in inline code in tables | diff --git a/src/lib.rs b/src/lib.rs
index 7f32382..47e0d65 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -79,6 +79,8 @@ pub struct State<'a> {
pub image_stack: Vec<ImageLink<'a>>,
/// Keeps track of the last seen heading's id, classes, and attributes
pub current_heading: Option<Heading<'a>>,
+ /// True... | 1 | 21 | 1 |
f6fba5f43d29fa5a617124dbfcba7fad12bcecbc | Sebastian Thiel | 2024-11-20T06:12:54 | minor improvements | diff --git a/examples/stupicat.rs b/examples/stupicat.rs
index 8857ebb..fb16e4e 100644
--- a/examples/stupicat.rs
+++ b/examples/stupicat.rs
@@ -1,8 +1,6 @@
use std::{
env,
- ffi::OsString,
- fs::File,
- io::{stdout, Read, Write},
+ io::{stdout, Write},
};
use pulldown_cmark::{Options, Parser};
@@... | 2 | 3 | 12 |
76c24a16cf34d1675bef52aa8b4c58edebefbfa8 | Michael Howell | 2024-10-16T20:31:58 | fix!: drasticly improve escaping `!`, `#`, and `|`
Raises spec tests from 578 to 580. It handles cases that look like these
Link, not image: \
This header ends with hashes, not an ATX trailer ###
====================================================
| a \| b | a \| c |
|--------|--------| | diff --git a/src/lib.rs b/src/lib.rs
index 3329b4f..98a30e0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -71,6 +71,8 @@ pub struct State<'a> {
pub last_was_text_without_trailing_newline: bool,
/// True if the last event was a paragraph start. Used to escape spaces at start of line (prevent spurrious indented c... | 7 | 88 | 20 |
b3d7df263409e2f9ebdaae843e087c714b994367 | Michael Howell | 2024-10-15T23:47:29 | chore: use `TextMergeStream` for round-trip tests
This increases the amount of passing tests to 578.
It doesn't strictly improve the quality of implementation,
but since separate text events aren't supposed to be semantic,
these failures seem spurrious. | diff --git a/tests/spec.rs b/tests/spec.rs
index 8d83422..87a85bc 100644
--- a/tests/spec.rs
+++ b/tests/spec.rs
@@ -1,3 +1,4 @@
+use pulldown_cmark::utils::TextMergeStream;
use pulldown_cmark::{CodeBlockKind, Event, Options, Parser, Tag, TagEnd};
use pulldown_cmark_to_cmark::cmark;
@@ -37,10 +38,10 @@ fn collect_t... | 1 | 3 | 2 |
33ce10da1ad5fac7d0f87aec1ce3f469ad10c29f | Max Heller | 2024-10-04T23:48:27 | remove allocation | diff --git a/src/lib.rs b/src/lib.rs
index ca07ca0..f1f528e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -463,17 +463,14 @@ where
BlockQuote(kind) => {
let every_line_padding = " > ";
let first_line_padding = kind
- .map(|kind| {
- ... | 1 | 8 | 11 |
210a0be86892446caa2cda11d0f712d6d0ff5078 | Michael Howell | 2024-09-05T05:48:06 | Fix incorrect variable name | diff --git a/src/text_modifications.rs b/src/text_modifications.rs
index 670920f..838a385 100644
--- a/src/text_modifications.rs
+++ b/src/text_modifications.rs
@@ -23,10 +23,10 @@ where
pub fn escape_leading_special_characters<'a>(
t: &'a str,
- is_in_block_quote: bool,
+ is_in_code_block: bool,
opt... | 1 | 2 | 2 |
7269c4f8aabb8ca3fdb63f4ba95b207899f9f845 | Sebastian Thiel | 2024-08-22T17:21:19 | Make clear that the rust-version field follows `pulldown-cmark`'s MSRV. | diff --git a/Cargo.toml b/Cargo.toml
index ed89bc1..563284d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,6 +16,7 @@ documentation = "https://docs.rs/crate/pulldown-cmark-to-cmark"
readme = "README.md"
edition = "2018"
include = ["src/*.rs", "LICENSE-APACHE", "README.md", "CHANGELOG.md"]
+# This follows the MSRV o... | 1 | 1 | 0 |
1a3029f41f4b97ddd1d2c0e373c63e1e388c40d9 | daniel.eades | 2024-08-20T12:27:38 | use 'Self' keyword (clippy::use_self) | diff --git a/src/lib.rs b/src/lib.rs
index e4b1dbc..340067e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -33,10 +33,10 @@ pub enum Alignment {
impl<'a> From<&'a TableAlignment> for Alignment {
fn from(s: &'a TableAlignment) -> Self {
match *s {
- TableAlignment::None => Alignment::None,
- ... | 1 | 4 | 4 |
5745ce5a6574434fd673533586b3cfb6d5123ea3 | daniel.eades | 2024-08-20T12:25:55 | remove unnecessary negation (clippy::if_not_else) | diff --git a/src/lib.rs b/src/lib.rs
index 4e7572a..e4b1dbc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -403,12 +403,12 @@ where
}
CodeBlock(CodeBlockKind::Fenced(info)) => {
state.is_in_code_block = true;
- let s = if !consumed_newlines {
+ ... | 1 | 3 | 3 |
820b661395d9855bf8c7a8c58e906f86741ce168 | daniel.eades | 2024-08-20T12:24:14 | remove unneeded 'ref' bindings (clippy::ref_binding_to_reference) | diff --git a/src/lib.rs b/src/lib.rs
index 858147c..4e7572a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -230,7 +230,7 @@ where
let last_was_text_without_trailing_newline = state.last_was_text_without_trailing_newline;
state.last_was_text_without_trailing_newline = false;
- match *event.borrow() {
+ ma... | 1 | 16 | 16 |
43c6e8a3ddffb91277cec72c11f5e9f714266b51 | daniel.eades | 2024-08-20T12:20:09 | nest or patterns (clippy::unnested_or_patterns) | diff --git a/src/lib.rs b/src/lib.rs
index 8f97441..858147c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -538,7 +538,7 @@ where
.push(state.text_for_header.take().unwrap_or_default());
Ok(())
}
- ref t @ TagEnd::TableRow | ref t @ TagEnd::TableHead => {
+ ... | 1 | 1 | 1 |
d636dc68f0b72088d761774d60e8762b26562cc4 | daniel.eades | 2024-08-20T12:17:42 | explicitly match unit values (clippy::ignored_unit_patterns) | diff --git a/src/lib.rs b/src/lib.rs
index 348d5e7..8f97441 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -406,20 +406,20 @@ where
let s = if !consumed_newlines {
formatter
.write_char('\n')
- .and_then(|_| padding(forma... | 1 | 5 | 5 |
a8c7fa5a77145021fe9d67741e4a00d40851919f | daniel.eades | 2024-08-20T12:16:19 | avoid explicit iter loops (clippy::explicit_iter_loop) | diff --git a/src/lib.rs b/src/lib.rs
index 5c9e33b..348d5e7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -465,12 +465,12 @@ where
formatter.write_char('#')?;
formatter.write_str(&id_str)?;
}
- for class in classes.iter() {
+ for cla... | 1 | 2 | 2 |
d97f8f5268f67f612474b68613eb5ff2941cb607 | Daniel Eades | 2024-08-20T06:44:58 | use inline format args (clippy::uninlined_format_args) | diff --git a/src/lib.rs b/src/lib.rs
index 3462dc5..5c9e33b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -342,7 +342,7 @@ where
Strong => formatter.write_str(options.strong_token),
FootnoteDefinition(ref name) => {
state.padding.push(" ".into());
- ... | 3 | 11 | 11 |
6e2ae15a167e3622993d7a96ca87619b48751281 | Daniel Eades | 2024-08-20T06:44:22 | remove needless raw string hashes (clippy::needless_raw_string_hashes) | diff --git a/tests/display.rs b/tests/display.rs
index 6ed1b7a..b83ca4c 100644
--- a/tests/display.rs
+++ b/tests/display.rs
@@ -319,14 +319,14 @@ fn footnote_reference() {
#[test]
fn math() {
assert_eq!(
- s(Event::InlineMath(r##"\sqrt{3x-1}+(1+x)^2"##.into())),
- r##"$\sqrt{3x-1}+(1+x)^2$"##
+ ... | 2 | 12 | 12 |
8f9d4bff7ca827b61ab1ca4ab7ca08d98721244f | Daniel Eades | 2024-08-20T06:43:32 | use semicolons if nothing returned (clippy::semicolon_if_nothing_returned) | diff --git a/src/lib.rs b/src/lib.rs
index 5247e53..3462dc5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -618,7 +618,7 @@ where
shortcut_text.push_str(text);
}
if let Some(text_for_header) = state.text_for_header.as_mut() {
- text_for_header.push_str(text)
+ ... | 4 | 111 | 111 |
17b5308e2592ef593e84a89cebbb28955024769b | Sebastian Thiel | 2024-08-20T05:10:46 | bump major version to help isolage the `pulldown-cmark` crate at v0.12 | diff --git a/Cargo.toml b/Cargo.toml
index 68abdde..8c3c853 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "pulldown-cmark-to-cmark"
-version = "15.0.1"
+version = "16.0.0"
authors = [
"Sebastian Thiel <byronimo@gmail.com>",
"Dylan Owen <dyltotheo@gmail.com>", | 1 | 1 | 1 |
173ae8507f34d4163c735c9ca5f6b4b83a338948 | Daniel Eades | 2024-08-19T20:41:20 | fix test | diff --git a/src/lib.rs b/src/lib.rs
index 3b4d6f3..5247e53 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -427,7 +427,7 @@ where
List(_) => Ok(()),
Strikethrough => formatter.write_str("~~"),
DefinitionList => Ok(()),
- DefinitionListTitle => Ok(()),
+ ... | 2 | 7 | 9 |
7674b549f0fb865c65d432ce4a5acfcc04af9c24 | Daniel Eades | 2024-08-19T18:25:27 | add failing test case | diff --git a/src/lib.rs b/src/lib.rs
index ee391aa..3b4d6f3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -607,9 +607,9 @@ where
Ok(())
}
TagEnd::Strikethrough => formatter.write_str("~~"),
- TagEnd::DefinitionList => todo!(),
- TagEnd::DefinitionListTitle ... | 2 | 21 | 3 |
e686a8f7ee35fe83fe1b7f8f6466b62d0af35fd9 | Daniel Eades | 2024-08-19T18:13:22 | add test for definition list item start | diff --git a/src/lib.rs b/src/lib.rs
index 16ad3e3..ee391aa 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -426,9 +426,9 @@ where
MetadataBlock(MetadataBlockKind::PlusesStyle) => formatter.write_str("+++\n"),
List(_) => Ok(()),
Strikethrough => formatter.write_str("~~"),
... | 2 | 8 | 3 |
f1a8a3efd57a9bff2073796387d70eba49d93399 | Daniel Eades | 2024-08-19T17:09:51 | add 'todo' placeholders | diff --git a/Cargo.toml b/Cargo.toml
index 2b09bff..68abdde 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ edition = "2018"
include = ["src/*.rs", "LICENSE-APACHE", "README.md", "CHANGELOG.md"]
[dependencies]
-pulldown-cmark = { version = "0.11.0", default-features = false }
+pulldown-cmark = { version ... | 4 | 10 | 4 |
33811dc085da284c82bb74da590b14066ff44402 | Ethiraric | 2024-06-16T16:21:17 | Fix emitting `::` for centered column in table.
Emitting `::` in a table to indicate alignment is `Center` seems to
break some parsers. Emitting `:-:` appears to work fine everywhere.
This commit also removes an allocation when encountering an empty header
cell. Rather than allocating a non-empty string, let the stri... | diff --git a/src/lib.rs b/src/lib.rs
index fbd8b46..d84ba97 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -530,13 +530,9 @@ where
Ok(())
}
TagEnd::TableCell => {
- state.table_headers.push(
- state
- .text_for_header
- ... | 2 | 52 | 10 |
d8cbd37355cacdf58625e08765cf4000914d1057 | Sebastian Thiel | 2024-06-15T15:20:01 | upgrade dev-dependencies | diff --git a/Cargo.toml b/Cargo.toml
index 17e30d7..030f226 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,5 +21,5 @@ include = ["src/*.rs", "LICENSE-APACHE", "README.md", "CHANGELOG.md"]
pulldown-cmark = { version = "0.11.0", default-features = false }
[dev-dependencies]
-indoc = "1.0.0"
-pretty_assertions = "0.7... | 2 | 5 | 5 |
6d05a28029087187bbbbe085aa77689c6ed89a07 | Roms1383 | 2024-06-13T11:47:28 | merge blockquote kind parsing | diff --git a/src/lib.rs b/src/lib.rs
index 479d80a..fbd8b46 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -370,8 +370,19 @@ where
}?;
formatter.write_char(' ')
}
- BlockQuote(None) => {
- state.padding.push(" > ".into());
+ ... | 1 | 13 | 20 |
89d5dd56d07fdc373ec901bc535862c5b2fac155 | Roms1383 | 2024-06-13T10:53:26 | remove unused import | diff --git a/src/lib.rs b/src/lib.rs
index bc78ce1..479d80a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,7 +4,7 @@ use std::{
borrow::{Borrow, Cow},
collections::HashSet,
fmt::{self, Write},
- ops::{Not, Range},
+ ops::Range,
};
use pulldown_cmark::{ | 1 | 1 | 1 |
74a5b5989c59c3d4dd1bff8f66b79be62bce0052 | Roms1383 | 2024-06-13T09:32:43 | use escaped comparison | diff --git a/src/lib.rs b/src/lib.rs
index 391efdb..91b1d57 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -643,7 +643,7 @@ where
let check = if checked { "x" } else { " " };
write!(formatter, "[{}] ", check)
}
- InlineMath(ref text) if text.contains('$') && (text.starts_with('`')... | 1 | 1 | 1 |
e94e9e4a259aa4747334f123c352a4812a14c42a | Roms1383 | 2024-06-13T09:29:49 | update math tests | diff --git a/tests/display.rs b/tests/display.rs
index 94bc6da..66af88b 100644
--- a/tests/display.rs
+++ b/tests/display.rs
@@ -313,6 +313,15 @@ fn footnote_reference() {
}
#[test]
fn math() {
- assert_eq!(s(Event::InlineMath("x".into())), "$x$");
- assert_eq!(s(Event::DisplayMath("x".into())), "$$x$$");
+ ... | 1 | 11 | 2 |
8e09ddb9d0c28873a5ae9c116a0a1f310179dc85 | Roms1383 | 2024-06-13T09:29:34 | fix alternate math notation | diff --git a/src/lib.rs b/src/lib.rs
index 479d80a..391efdb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,7 +4,7 @@ use std::{
borrow::{Borrow, Cow},
collections::HashSet,
fmt::{self, Write},
- ops::Range,
+ ops::{Not, Range},
};
use pulldown_cmark::{
@@ -643,6 +643,9 @@ where
let... | 1 | 4 | 1 |
1d047be50ca18ffd5a28ca64475d1100b6068cca | Roms1383 | 2024-06-13T08:34:12 | fix incorrect formatting | diff --git a/src/lib.rs b/src/lib.rs
index 31cb966..479d80a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -391,9 +391,7 @@ where
BlockQuoteKind::Warning => "WARNING",
BlockQuoteKind::Caution => "CAUTION",
};
- state.padding.push(for... | 1 | 1 | 3 |
8723b1ffcf2248d8fbad77c044d6eff96dda2fec | Roms1383 | 2024-06-11T11:13:17 | update tests | diff --git a/tests/display.rs b/tests/display.rs
index e0d73fc..94bc6da 100644
--- a/tests/display.rs
+++ b/tests/display.rs
@@ -34,7 +34,7 @@ mod rule {
mod start {
use pulldown_cmark::{
Alignment::{self, Center, Left, Right},
- CodeBlockKind,
+ BlockQuoteKind, CodeBlockKind,
Even... | 2 | 22 | 3 |
c81d969679b77dd0e9f9bf065190cfddc57f3dd3 | Roms1383 | 2024-06-11T11:13:04 | handle new types and change | diff --git a/src/lib.rs b/src/lib.rs
index 966b579..31cb966 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,7 +7,9 @@ use std::{
ops::Range,
};
-use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType, MetadataBlockKind, Tag, TagEnd};
+use pulldown_cmark::{
+ Alignment as TableAlignmen... | 1 | 26 | 2 |
173b8a40761d571772815f4227e3962a619bd7fd | Roms1383 | 2024-06-11T11:12:37 | update pulldown-cmark | diff --git a/Cargo.toml b/Cargo.toml
index c8ba63c..17e30d7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ edition = "2018"
include = ["src/*.rs", "LICENSE-APACHE", "README.md", "CHANGELOG.md"]
[dependencies]
-pulldown-cmark = { version = "0.10.0", default-features = false }
+pulldown-cmark = { version ... | 1 | 1 | 1 |
7376d42ae3599c907061eba6b3a7676f79408bdb | Steven Hé (Sīchàng) | 2024-06-10T12:40:29 | fix(#73) do not disturb code block detection when preventing escape | diff --git a/src/source_range.rs b/src/source_range.rs
index d7fda6a..ad55332 100644
--- a/src/source_range.rs
+++ b/src/source_range.rs
@@ -39,6 +39,8 @@ where
for (event, range) in event_and_ranges {
let update_event_end_index = !matches!(*event.borrow(), Event::Start(_));
let prevent_escape_le... | 2 | 37 | 3 |
cfcabc44bf5b73ab1567f062787be917d1933877 | Sebastian Thiel | 2024-06-10T06:04:41 | fix manifest includes to allow publishing | diff --git a/Cargo.toml b/Cargo.toml
index 944fdf3..7f62a56 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,7 +15,7 @@ homepage = "https://github.com/Byron/pulldown-cmark-to-cmark"
documentation = "https://docs.rs/crate/pulldown-cmark-to-cmark"
readme = "README.md"
edition = "2018"
-include = ["src/lib.rs", "LICENSE... | 1 | 1 | 1 |
d9d81c0bcac2471a26be35e21414f51b4a136b45 | Sebastian Thiel | 2024-06-10T06:03:18 | fix doc-links | diff --git a/src/source_range.rs b/src/source_range.rs
index 9db3cd1..d7fda6a 100644
--- a/src/source_range.rs
+++ b/src/source_range.rs
@@ -3,8 +3,9 @@ use super::{cmark_resume_one_event, fmt, Borrow, Event, Options, Range, State};
/// Serialize a stream of [pulldown-cmark-Events][Event] while preserving the escape c... | 1 | 3 | 2 |
6c8297c03eb82ac95fa9dd559e3337e470d70c72 | Sebastian Thiel | 2024-05-30T05:35:30 | fix!: clarify what `last_event_end_index` indices into and how it's used
This is marked as breaking change as the field itself is new in `State`
and could be breaking for some. | diff --git a/src/lib.rs b/src/lib.rs
index f78cb56..966b579 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -72,7 +72,10 @@ pub struct State<'a> {
pub current_shortcut_text: Option<String>,
/// A list of shortcuts seen so far for later emission
pub shortcuts: Vec<(String, String, String)>,
- /// Index of ... | 1 | 4 | 1 |
f66724b2f74814fe6a8ddb168425b9097bb84135 | Steven Hé (Sīchàng) | 2024-05-30T02:41:33 | dedup test code | diff --git a/tests/fmt.rs b/tests/fmt.rs
index 3b948fa..bf39921 100644
--- a/tests/fmt.rs
+++ b/tests/fmt.rs
@@ -4,6 +4,26 @@ extern crate indoc;
use pulldown_cmark::{Alignment, CodeBlockKind, Event, LinkType, Options, Parser, Tag, TagEnd};
use pulldown_cmark_to_cmark::{cmark, cmark_resume, cmark_resume_with_options,... | 2 | 153 | 1,169 |
bebff1e520f2da982cb1a7f9ba97ce13c9accab0 | Steven Hé (Sīchàng) | 2024-05-30T02:02:31 | attempt to address @Bryon first comments
https://github.com/Byron/pulldown-cmark-to-cmark/pull/71#pullrequestreview-2081814286 | diff --git a/src/lib.rs b/src/lib.rs
index 6443b63..f78cb56 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -12,7 +12,10 @@ use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType,
mod source_range;
mod text_modifications;
-pub use source_range::*;
+pub use source_range::{
+ cmark_resume_with... | 3 | 13 | 9 |
542bc1fad3d06d39d59c8842225afc864d7539c3 | Steven Hé (Sīchàng) | 2024-05-25T23:43:25 | test `<` escape handling | diff --git a/tests/source_range_fmt.rs b/tests/source_range_fmt.rs
index 70878ca..092ee82 100644
--- a/tests/source_range_fmt.rs
+++ b/tests/source_range_fmt.rs
@@ -309,6 +309,32 @@ mod inline_elements {
)
)
}
+
+ #[test]
+ fn preserve_less_than_sign_escape() {
+ // `<` is not es... | 1 | 26 | 0 |
ea17e2763d066bd454cfab0ae0a0768fdaf83bd1 | Steven Hé (Sīchàng) | 2024-05-25T16:09:07 | restore `State` derives | diff --git a/src/lib.rs b/src/lib.rs
index 6c657eb..6443b63 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -39,7 +39,7 @@ impl<'a> From<&'a TableAlignment> for Alignment {
/// The state of the [`cmark_resume()`] and [`cmark_resume_with_options()`] functions.
/// This does not only allow introspection, but enables the us... | 1 | 1 | 1 |
78965c4520e031930e232758d942077ed40b7a1d | Steven Hé (Sīchàng) | 2024-05-25T16:07:39 | rm test that fail for old implementation | diff --git a/tests/fmt.rs b/tests/fmt.rs
index 7d455f6..3b948fa 100644
--- a/tests/fmt.rs
+++ b/tests/fmt.rs
@@ -395,22 +395,6 @@ mod inline_elements {
)
)
}
-
- #[test]
- #[ignore]
- fn rustdoc_link() {
- // Brackets are not escaped if necessary.
- assert_eq!(
- ... | 1 | 0 | 16 |
49f60d58ae2a1fd868797191c47d968f11c913df | Steven Hé (Sīchàng) | 2024-05-25T15:32:50 | better explain why `cmark_resume_with_source_range_and_options` is different | diff --git a/src/source_range.rs b/src/source_range.rs
index 4f37c1d..035078b 100644
--- a/src/source_range.rs
+++ b/src/source_range.rs
@@ -2,6 +2,10 @@ use super::*;
/// Serialize a stream of [pulldown-cmark-Events][Event] each with source string into a string-backed buffer.
///
+/// Different from [`cmark_resume... | 1 | 4 | 0 |
92ad2c8f291df7e165e1110d05c638661627c5d6 | Steven Hé (Sīchàng) | 2024-05-25T15:23:44 | `source_range` persist special character escape by peeking source
new `State::last_event_end_index` to track event end
source_mapping → source_range | diff --git a/src/lib.rs b/src/lib.rs
index 5f606fb..6c657eb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,14 +4,15 @@ use std::{
borrow::{Borrow, Cow},
collections::HashSet,
fmt::{self, Write},
+ ops::Range,
};
use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType, Metad... | 3 | 61 | 24 |
a234ed5ece9d02eb8e9cb3c03432ca2a73165b5e | Steven Hé (Sīchàng) | 2024-05-25T11:31:07 | placeholder functions not using source range | diff --git a/src/lib.rs b/src/lib.rs
index 565369c..5f606fb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -8,8 +8,10 @@ use std::{
use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType, MetadataBlockKind, Tag, TagEnd};
+mod source_mapping;
mod text_modifications;
+pub use source_mapping:... | 3 | 1,203 | 0 |
93cbb33bad931ac3f787cd13438a812c6adb3b7a | Steven Hé (Sīchàng) | 2024-05-25T09:29:04 | extract nested functionalities | diff --git a/src/lib.rs b/src/lib.rs
index 45a3f38..565369c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -8,6 +8,10 @@ use std::{
use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType, MetadataBlockKind, Tag, TagEnd};
+mod text_modifications;
+
+use text_modifications::*;
+
/// Similar to... | 2 | 443 | 429 |
8c6ccdbb01e015acc3a7e688bac2dad8319d03f8 | Steven Hé (Sīchàng) | 2024-05-25T09:08:14 | failing rustdoc test
<https://github.com/Byron/pulldown-cmark-to-cmark/issues/51> | diff --git a/tests/fmt.rs b/tests/fmt.rs
index 3b948fa..7d455f6 100644
--- a/tests/fmt.rs
+++ b/tests/fmt.rs
@@ -395,6 +395,22 @@ mod inline_elements {
)
)
}
+
+ #[test]
+ #[ignore]
+ fn rustdoc_link() {
+ // Brackets are not escaped if necessary.
+ assert_eq!(
+ ... | 1 | 16 | 0 |
b8ae35906a62e5e6d69b5412fff6a9a93918925e | Sebastian Thiel | 2024-03-17T06:56:59 | refactor
- simplify tests
- document new option field | diff --git a/src/lib.rs b/src/lib.rs
index 91aff8e..45a3f38 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -104,6 +104,7 @@ pub struct Options<'a> {
pub newlines_after_list: usize,
pub newlines_after_blockquote: usize,
pub newlines_after_rest: usize,
+ /// The amount of newlines placed after TOML or YAML... | 2 | 19 | 82 |
8d39a30b20b621a0db6274ee6bb58755c5198d01 | Mads Hougesen | 2024-03-16T12:21:14 | feat: add newlines_after_metadata option | diff --git a/src/lib.rs b/src/lib.rs
index b54d780..91aff8e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -104,6 +104,7 @@ pub struct Options<'a> {
pub newlines_after_list: usize,
pub newlines_after_blockquote: usize,
pub newlines_after_rest: usize,
+ pub newlines_after_metadata: usize,
/// Token c... | 2 | 154 | 7 |
7b27baad538570400eeb651b2e9b2b786ad43189 | Mads Hougesen | 2024-03-16T10:36:21 | fix: set correct yaml metablock end tag | diff --git a/src/lib.rs b/src/lib.rs
index e65fd4d..b54d780 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -533,8 +533,8 @@ where
}
Ok(())
}
- TagEnd::MetadataBlock(MetadataBlockKind::PlusesStyle) => formatter.write_str("+++"),
- TagE... | 2 | 51 | 2 |
366f304104ec27e96f185ead57658532ecaecaa7 | Max Heller | 2024-03-16T01:01:02 | avoid allocations | diff --git a/src/lib.rs b/src/lib.rs
index 672fc8a..e65fd4d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -52,11 +52,11 @@ pub struct State<'a> {
/// True if the last event was text and the text does not have trailing newline. Used to inject additional newlines before code block end fence.
pub last_was_text_wit... | 1 | 22 | 22 |
b3bfd404951c19314e110ee2764ea69b8cd4a9e2 | Max Heller | 2024-03-16T00:49:14 | allow State to borrow from events | diff --git a/src/lib.rs b/src/lib.rs
index 81ceee2..672fc8a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -181,9 +181,9 @@ impl<'a> Options<'a> {
pub fn cmark_resume_with_options<'a, I, E, F>(
events: I,
mut formatter: F,
- state: Option<State<'static>>,
+ state: Option<State<'a>>,
options: Options<... | 2 | 9 | 13 |
42739b5996a2490c61b792cfc32b980614892ae0 | Max Heller | 2024-03-16T00:47:07 | remove State::last_was_html | diff --git a/src/lib.rs b/src/lib.rs
index fe284c6..81ceee2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -49,8 +49,6 @@ pub struct State<'a> {
pub text_for_header: Option<String>,
/// Is set while we are handling text in a code block
pub is_in_code_block: bool,
- /// True if the last event was html. Us... | 1 | 0 | 2 |
6afb4cdf66344b3701cdc30d393aec7d0356480a | Max Heller | 2024-03-15T23:47:40 | fix handling of HTML blocks | diff --git a/src/lib.rs b/src/lib.rs
index 6fa2533..fe284c6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -100,6 +100,7 @@ pub struct Options<'a> {
pub newlines_after_headline: usize,
pub newlines_after_paragraph: usize,
pub newlines_after_codeblock: usize,
+ pub newlines_after_htmlblock: usize,
pu... | 1 | 21 | 22 |
38bb5dddc8b5603849c6ce006f96d4f93f83784c | Max Heller | 2024-03-15T21:18:26 | fix EndTag tests | diff --git a/tests/display.rs b/tests/display.rs
index 98e3966..e0d73fc 100644
--- a/tests/display.rs
+++ b/tests/display.rs
@@ -2,8 +2,11 @@ use pulldown_cmark::Event;
use pulldown_cmark_to_cmark::*;
fn s(e: Event) -> String {
+ es([e])
+}
+fn es<'a>(es: impl IntoIterator<Item = Event<'a>>) -> String {
let... | 1 | 53 | 39 |
82110a4cc62d2fac7fa5d12842807b9264e45deb | Max Heller | 2024-03-03T17:19:01 | comment out end tag tests that aren't triviably updateable | diff --git a/tests/display.rs b/tests/display.rs
index f4a8609..98e3966 100644
--- a/tests/display.rs
+++ b/tests/display.rs
@@ -170,15 +170,7 @@ mod start {
}
mod end {
- use pulldown_cmark::{
- Alignment::{self, Center, Left, Right},
- CodeBlockKind,
- Event::*,
- HeadingLevel,
- ... | 1 | 36 | 44 |
fc30c6dbc2457bf2c68ea70b66be80fd64016d5a | Max Heller | 2024-02-26T19:36:35 | support heading attributes | diff --git a/src/lib.rs b/src/lib.rs
index 4416e47..66c854b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -57,8 +57,8 @@ pub struct State<'a> {
pub link_stack: Vec<LinkCategory>,
/// Currently open images
pub image_stack: Vec<ImageLink>,
- /// Keeps track of the last seen heading's id and classes
- p... | 2 | 30 | 11 |
ea2608e88cabcbc9962b08360e624e176b780c19 | Max Heller | 2024-02-26T19:09:41 | fix test | diff --git a/tests/fmt.rs b/tests/fmt.rs
index 90a6917..42409e3 100644
--- a/tests/fmt.rs
+++ b/tests/fmt.rs
@@ -47,7 +47,7 @@ mod lazy_newlines {
#[test]
fn after_emphasis_there_is_no_newline() {
- for t in &[
+ for t in [
Tag::Emphasis,
Tag::Strong,
Tag... | 1 | 3 | 2 |
ebf9b6914c9eccbc0efc9bfed3d26ccfb64ff3c5 | Max Heller | 2024-02-24T20:39:22 | fix easily-updateable tests | diff --git a/examples/stupicat.rs b/examples/stupicat.rs
index df31535..8857ebb 100644
--- a/examples/stupicat.rs
+++ b/examples/stupicat.rs
@@ -36,7 +36,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
fn read_to_string(path: OsString) -> String {
- let mut file = File::open(&path).expect("file to e... | 6 | 131 | 56 |
3090b8a7c3026e2a5fa3b2fbaf4fe9753ec662a9 | Max Heller | 2024-02-24T20:16:53 | add link/image stacks and track current header | diff --git a/src/lib.rs b/src/lib.rs
index 59e8aba..2cd428b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -53,6 +53,12 @@ pub struct State<'a> {
pub last_was_html: bool,
/// True if the last event was text and the text does not have trailing newline. Used to inject additional newlines before code block end fenc... | 1 | 86 | 23 |
a26731caaaa89960528b8c72d6c051c7c30d4660 | Max Heller | 2024-02-13T01:01:42 | metadata blocks | diff --git a/src/lib.rs b/src/lib.rs
index f234325..59e8aba 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -6,7 +6,7 @@ use std::{
fmt::{self, Write},
};
-use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType, Tag, TagEnd};
+use pulldown_cmark::{Alignment as TableAlignment, Event, Heading... | 1 | 5 | 1 |
b90defbf6ade8b3c1c0585f7933421f086eeb123 | Max Heller | 2024-02-10T21:46:56 | WIP: update pulldown-cmark dependency | diff --git a/Cargo.toml b/Cargo.toml
index c6a23e2..09b121a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ edition = "2018"
include = ["src/lib.rs", "LICENSE-APACHE", "README.md", "CHANGELOG.md"]
[dependencies]
-pulldown-cmark = { version = "0.9.0", default-features = false }
+pulldown-cmark = { version... | 2 | 33 | 26 |
e33936543e4db169fb7734cc0ce83127a0c04e8b | Sebastian Thiel | 2024-01-27T07:28:44 | feat: introduce `calculate_code_block_token_count()`, along with `DEFAULT_CODE_BLOCK_TOKEN_COUNT`.
That way it's possible to correctly determine the amount of fenced code-block tokens
needed to render all given events such that code-blocks are retained. | diff --git a/src/lib.rs b/src/lib.rs
index 7a53cd1..ef1d595 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -60,6 +60,9 @@ pub struct State<'a> {
pub shortcuts: Vec<(String, String, String)>,
}
+/// Thea mount of code-block tokens one needs to produce a valid fenced code-block.
+pub const DEFAULT_CODE_BLOCK_TOKEN_C... | 2 | 114 | 125 |
ef1c2766c1f91ba226063e4f914646f0d32172da | dalance | 2024-01-27T02:51:04 | Change the return type of count_code_block_tokens | diff --git a/src/lib.rs b/src/lib.rs
index d0208fb..7a53cd1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -87,8 +87,6 @@ pub struct Options<'a> {
pub strong_token: &'a str,
}
-const DEFAULT_CODE_BLOCK_TOKEN_COUNT: usize = 4;
-
const DEFAULT_OPTIONS: Options<'_> = Options {
newlines_after_headline: 2,
n... | 1 | 19 | 20 |
c0f631d68a9373bf662302296044d90eaac4c8b6 | Sebastian Thiel | 2024-01-25T08:37:21 | refactor
- rename function, some doc-string fixes
- Use `IntoIterator` instead of `Iterator` | diff --git a/src/lib.rs b/src/lib.rs
index 9dca7e8..d0208fb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -77,7 +77,7 @@ pub struct Options<'a> {
pub newlines_after_blockquote: usize,
pub newlines_after_rest: usize,
/// Token count for fenced code block. An appropriate value of this field can be decided by... | 1 | 23 | 26 |
f119d7735fa1ed762fedf4a614a76bd0c7fbb33f | dalance | 2024-01-24T09:40:22 | Add check_code_block_token_count function | diff --git a/src/lib.rs b/src/lib.rs
index 2999585..9dca7e8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -6,7 +6,7 @@ use std::{
fmt::{self, Write},
};
-use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType};
+use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkTy... | 1 | 159 | 2 |
4767b2fe2dea1c4f0a563d3e71cdb54bd8efc8bc | Max Heller | 2023-11-24T14:32:08 | address code review comments | diff --git a/src/lib.rs b/src/lib.rs
index be7c47e..2999585 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,7 +3,7 @@
use std::{
borrow::{Borrow, Cow},
collections::HashSet,
- fmt,
+ fmt::{self, Write},
};
use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType};
@@ -599,13 +... | 2 | 12 | 5 |
74f0abee0dcfde1148af57e2acc0451b12ce1308 | Max Heller | 2023-11-23T20:52:55 | escape double quotes in link titles | diff --git a/src/lib.rs b/src/lib.rs
index 84895c8..be7c47e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -588,7 +588,7 @@ where
write!(f, "]{}{uri}", separator, uri = uri)?;
}
if !title.is_empty() {
- write!(f, " \"{title}\"", title = title)?;
+ write!(f, " \"{title}\"", title = EscapeLi... | 2 | 20 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.