-
Notifications
You must be signed in to change notification settings - Fork 327
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
Modify Markdown dl
syntax to support multiple subsequent dt
or dd
elements
#2340
Comments
Advanced Cases:Preceding paragraph
First term
Second term
: Description, first paragraph
Description, second paragraph
- Description, unordered list item
> Description, block quote
Following paragraph <p>Preceding paragraph</p>
<dl>
<dt>First term</dt>
<dt>Second Term</dt>
<dd>
<p>Description, first paragraph</p>
<p>Description, second paragraph</p>
<ul>
<li>Description, unordered list item</li>
</ul>
<blockquote>Description, block quote</blockquote>
</dd>
</dl>
<p>Following paragraph</p> |
What would you see this be displayed as when entered into the Homebrewery? Any particular style/format from the D&D books that a multi-dd would be used for? |
@ericscheid I believe the ticket and associated pull request actually use bold tags and paragraphs to accomplish that? Is this incorrect? @calculuschild honestly, there's nothing here we can't reproduce via bold tags and default paragraph indents (or just manually writing one's own |
This is already handled naturally by just using normal paragraphs, since we don't use @develleoper One issue we had in the original version of the Homebrewery was over-use of obscure syntax combinations to activate different features (two So, we're open to adding syntax for stuff, but we do want to make sure it has a clear utility that isn't already covered by other syntax. It's nice to have some syntax (like multi-dd) left as a backup for some future element we haven't accounted for yet. We also don't want multiple syntaxes that do the same thing if we can help it. Once a syntax is out on the site, even if we don't give it any special styling and it just appears as a standard paragraph, that locks us out of using it in the future for something more specialized. For example if you are using it just for equipment lists that appear as a standard paragraph anyway, and we change it to appear more as a big blocky stylized box, suddenly all of your brews that relied on the previous appearance will be broken. |
This works because that list action names and their respective definitions are styled using paragraphs to look like a definition list. This is a workaround. If however there was another theme that said "definition lists look like this [whatever]" (including multi-paragraph Perhaps @develleoper could work up a PR which merges all three options: a simple one-line syntax for one-definition terms:
multiple definition terms:
indented definitions to support complex definitions
For the latter two cases (if possible due to parsing logic) make the |
There are literallly no definition list present in that part of the statblock. It's not merely a workaround that styles |
Yes, sorry, that's what I meant: the "bit of text that is a definition in a list". Which is a |
@calculuschild Yeah, I noticed that the current implementation just uses bold tags and paragraph breaks, and honestly, that is good enough for users to reproduce 5e styles. I totally understand the battle against syntax bloat, I'm just advocating for altering the current (unused?) And @ericscheid, I don't want to jump the gun, but will happily work up a PR, if that's acceptable. |
The current single-line dl syntax is indeed used in multiple places already on the Homebrewery, so we can't eliminate it entirely without breaking existing documents. In fact, it was a deliberate choice to break from the other syntax because the occurences where we use DL only require a single dt and dd; the Again, we welcome the new syntax (and an accompanying PR), but we would want to have a clear decided use for it. We don't want users to rely on it only to be surprised later on when we finally figure out a use case and start adding styling.
@ericscheid I see your point, but I would argue that this specific example is not really a Term with two definitions. The second paragraph is part of the same definition. So it's still a single term, single definition, but we would be hijacking multiple dds to artificially split the definition into paragraphs, which is not really semantically correct either. (For what its worth, I personally I still think this example is semantically closer to a paragraph than a definition list anyway.) Regardless, while I agree semantic HTML is good, I suggest that avoiding syntax bloat is more important if the output is visually identical. I am not keen to confuse users by making Stat blocks into a weird outlier that uses a whole different syntax where everywhere else a paragraph would do the same thing. Tldr; if we add a new syntax, it should do something we can't easily do already. Add features, not duplicate features, if that makes sense. |
Yes, it is a term with one definition with two paragraphs — which is part of the proposal. It would be written as:
|
@calculuschild yeah, that totally makes sense. I'm curious why the decision was made to support I apologize for the lack of clear use-case, and am still pondering that |
also apologies for the accidentally closed issue, my cat stepped on my touch pad and hit "close with comment" 🤦♀️😼 |
See PR here: 64d133f The IIRC, at the time there was no clear markdown-community consensus on how to do definition lists, and Marked didn't have much guidance. We rolled with a simple syntax that worked for the immediate need. That extension was added in July 2021. The use of that syntax for monster actions was added in Sep 2021 (i.e. the use case in #181 wasn't considered in July) |
That sounds about right. I'll add that I think we may have been "inspired" by the
syntax somewhere along the way, since we ended up using colons as well. I suspect the reasoning for coming up with our own syntax was something like, "DL syntax isn't in any official specs, and is only a custom extension in a couple of Markdown parsers. Let's tweak it a bit to fit into one line since we will only ever use a single term and definition anyway." Since Markdown is meant to be "as readable as possible... publishable as-is, as plain text" , the single-line DL we came up with seemed to match our actual output appearance in a way that remained legible, better than breaking the DL across multiple lines:
vs
although I think technically both syntaxes should be able to coexist without interference. |
Oh! That actually makes a lot of sense, and I find myself agreeing with regard to legibility of the code for this purpose. Thank you for the context! |
This should be fixed with #3129 |
Description
The current
<dl>
syntax (i.e.dt :: dd
) only supports a 1:1 ratio of terms to descriptions.Reference
Basic Case:
The text was updated successfully, but these errors were encountered: