Skip to content

Markdown in list items is not applied #371

@williammartin

Description

@williammartin

Description

Consider:

1. **foo**
1. _bar_

We would expect to see the bold and italic styling applied:

  1. foo
  2. bar

However, the styles are not applied. I cannot see anything in listitem which would apply them (

marked-terminal/index.js

Lines 155 to 188 in 7eb3cd3

Renderer.prototype.listitem = function (text) {
if (typeof text === 'object') {
const item = text;
text = '';
if (item.task) {
const checkbox = this.checkbox({ checked: !!item.checked });
if (item.loose) {
if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {
item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
if (
item.tokens[0].tokens &&
item.tokens[0].tokens.length > 0 &&
item.tokens[0].tokens[0].type === 'text'
) {
item.tokens[0].tokens[0].text =
checkbox + ' ' + item.tokens[0].tokens[0].text;
}
} else {
item.tokens.unshift({
type: 'text',
raw: checkbox + ' ',
text: checkbox + ' '
});
}
} else {
text += checkbox + ' ';
}
}
text += this.parser.parse(item.tokens, !!item.loose);
}
var transform = compose(this.o.listitem, this.transform);
var isNested = text.indexOf('\n') !== -1;
if (isNested) text = text.trim();
), which I guess is where I would expect some amount of recursive styling? I'm not sure what the limit is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions