-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance description lists #462
base: main
Are you sure you want to change the base?
Conversation
Run on Mon Sep 2 17:20:02 UTC 2024 |
127649b
to
3694ebe
Compare
src/parser/mod.rs
Outdated
// ATTEMPT 1 | ||
// reopen_ast_nodes(last_child); | ||
// | ||
// let details = | ||
// self.add_child(last_child, NodeValue::DescriptionDetails, self.first_nonspace + 1); | ||
// *container = details; | ||
// | ||
// true | ||
|
||
// ATTEMPT 2 | ||
// let parent = last_child.parent().unwrap(); | ||
// let item = parent.last_child().unwrap(); | ||
// | ||
// reopen_ast_nodes(item); | ||
// | ||
// let details = | ||
// self.add_child(item, NodeValue::DescriptionDetails, self.first_nonspace + 1); | ||
// *container = details; | ||
// | ||
// true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kivikakk I was wondering if you could take a look at this.
I realized that when supporting multiple definitions, the second DescriptionDetails
gets added as an entirely new DescriptionItem
, rather than being added as a child to the existing DescriptionItem
.
But both my attempts to do this resulted in the assert!(ast.open);
in finalize_borrowed
tripping.
Sample input
foo
: bar
: one
I thought maybe it's the shenanigans I'm doing at line 1760, the None
case, but using the following input (with blanks lines) bypasses that and it still asserts.
foo
: bar
: one
Even with re-opening the ast node, it's not working. I'm missing some magic incantation. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get multiple detail nodes added to a description item. But thinking about it again, I really think it's ok - it just means that there can be multiple DescriptionItem
with just a DescriptionDetails
, but no term. Actually I think this is fine. The HTML formatter doesn't care.
f96ea1d
to
56679d6
Compare
56679d6
to
54668df
Compare
Work in progress. Enhancing description lists.
Add support for multiple description definitions
Allow for the definition to follow after the term without a blank line
Allow a definition list to be either "tight" or "loose", same as a normal list. Related to Description lists with tight and loose syntax #327
Waffling on this one. "Tight" and "loose" lists add complexity, and is not well understood by users. Most implementations I've seen do support the distinction. However not supporting it means styling the list would be easier and less complex. 🤷