Skip to content

Commit c4277a9

Browse files
authored
Merge pull request #148 from akiomik/dependabot/cargo/comrak-0.38.0
build(deps): bump comrak from 0.36.0 to 0.38.0
2 parents d8261ad + 6607b6d commit c4277a9

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ exclude = [
2323
clap = { version = "4.5.35", features = ["derive"] }
2424
clap_complete = "4.5.47"
2525
colored = "3.0.0"
26-
comrak = "0.36.0"
26+
comrak = "0.38.0"
2727
etcetera = "0.10.0"
2828
globset = { version = "0.4.16", features = ["serde1"] }
2929
ignore = "0.4.23"

src/rule/md027.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,7 @@ impl RuleLike for MD027 {
4545
let block_quote_position = node.data.borrow().sourcepos;
4646
let inline_position = inline_node.data.borrow().sourcepos;
4747
let lineno = inline_position.start.line;
48-
49-
// NOTE: `code` pos is wrong: https://github.com/kivikakk/comrak/issues/503
50-
let is_code =
51-
matches!(inline_node.data.borrow().value, NodeValue::Code(_));
52-
let expected_column = if is_code {
53-
block_quote_position.start.column + 3
54-
} else {
55-
block_quote_position.start.column + 2
56-
};
48+
let expected_column = block_quote_position.start.column + 2;
5749

5850
if inline_position.start.column > expected_column
5951
&& !lines.contains(&lineno)
@@ -129,7 +121,7 @@ mod tests {
129121
rule.to_violation(path.clone(), Sourcepos::from((2, 4, 2, 16))),
130122
rule.to_violation(path.clone(), Sourcepos::from((4, 4, 4, 9))),
131123
rule.to_violation(path.clone(), Sourcepos::from((5, 4, 5, 13))),
132-
rule.to_violation(path.clone(), Sourcepos::from((6, 5, 6, 8))),
124+
rule.to_violation(path.clone(), Sourcepos::from((6, 4, 6, 9))),
133125
rule.to_violation(path, Sourcepos::from((7, 4, 7, 30))),
134126
];
135127
assert_eq!(actual, expected);

src/rule/md038.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl RuleLike for MD038 {
3737
for node in doc.ast.descendants() {
3838
if let NodeValue::Code(code) = &node.data.borrow().value {
3939
let position = node.data.borrow().sourcepos;
40-
let content_len = position.end.column - position.start.column + 1;
40+
let content_len = position.end.column - position.start.column - 1;
4141
if code.literal.trim() != code.literal || code.literal.len() != content_len {
4242
let violation = self.to_violation(doc.path.clone(), position);
4343
violations.push(violation);
@@ -75,9 +75,9 @@ mod tests {
7575
let rule = MD038::new();
7676
let actual = rule.check(&doc)?;
7777
let expected = vec![
78-
rule.to_violation(path.clone(), Sourcepos::from((1, 2, 1, 12))),
79-
rule.to_violation(path.clone(), Sourcepos::from((3, 2, 3, 11))),
80-
rule.to_violation(path, Sourcepos::from((5, 2, 5, 11))),
78+
rule.to_violation(path.clone(), Sourcepos::from((1, 1, 1, 13))),
79+
rule.to_violation(path.clone(), Sourcepos::from((3, 1, 3, 12))),
80+
rule.to_violation(path, Sourcepos::from((5, 1, 5, 12))),
8181
];
8282
assert_eq!(actual, expected);
8383
Ok(())

0 commit comments

Comments
 (0)