Skip to content

Commit

Permalink
sourcepos: not bothering with desc lists for now
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Mar 31, 2023
1 parent d5d067b commit 575a987
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ pub struct ComrakExtensionOptions {
/// Each term must be defined in one paragraph, followed by a blank line,
/// and then by the details. Details begins with a colon.
///
/// Not (yet) compatible with render.sourcepos.
///
/// ``` md
/// First term
///
Expand Down Expand Up @@ -514,6 +516,8 @@ pub struct ComrakRenderOptions {

/// Include source position attributes in XML output.
///
/// Not yet compatible with extension.description_lists.
///
/// ```rust
/// # use comrak::{markdown_to_commonmark_xml, ComrakOptions};
/// let mut options = ComrakOptions::default();
Expand Down Expand Up @@ -1342,7 +1346,7 @@ impl<'a, 'o, 'c> Parser<'a, 'o, 'c> {

last_child.detach();

// TODO: all the start_column stuff is probably wrong
// TODO: description list sourcepos is totally broken.
let list = match container.last_child() {
Some(lc) if node_matches!(lc, NodeValue::DescriptionList) => {
reopen_ast_nodes(lc);
Expand Down
18 changes: 18 additions & 0 deletions src/tests/description_lists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,21 @@ fn description_lists() {
),
);
}

// #[test]
// fn sourcepos() {
// // So much work to do here still.
// assert_ast_match!(
// [extension.description_lists],
// "ta\n"
// "\n"
// ": da\n"
// "\n"
// "t*b*\n"
// "\n"
// ": d_b_\n",
// (document (1:1-1:1) [

// ])
// );
// }

0 comments on commit 575a987

Please sign in to comment.