-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Indented list not correctly converted #19
Labels
Comments
It looks like the current version doesn't track the current list level, so this will likely require a partial/full rewrite before we can get it working properly. |
tomzx
added a commit
to TomzxForks/html-to-markdown
that referenced
this issue
Jul 25, 2015
Add an openElement/closeElement to the converters so that they may track additional information once they're about to be converted/have been converted. This allows us to track the number of ul/ol opened, such that when we render the li element, we know the current indent level.
tomzx
added a commit
to TomzxForks/html-to-markdown
that referenced
this issue
Jul 25, 2015
Add an openElement/closeElement to the converters so that they may track additional information once they're about to be converted/have been converted. This allows us to track the number of ul/ol opened, such that when we render the li element, we know the current indent level.
tomzx
added a commit
to TomzxForks/html-to-markdown
that referenced
this issue
Jul 25, 2015
Add an openElement/closeElement to the converters so that they may track additional information once they're about to be converted/have been converted. This allows us to track the number of ul/ol opened, such that when we render the li element, we know the current indent level.
Would this change to $value = implode("\n", $lines);
if ($list_type === 'ul') {
$indent = '- ';
} else {
$number = $element->getSiblingPosition();
$indent = $number . '. ';
}
$value = trim($value);
$value = preg_replace('~\n~', "\n" . str_repeat(' ', strlen($indent)), $value);
$markdown = $indent . $value . "\n"; |
Fixed by #84 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The list
should be converted to:
But it is being converted to:
The text was updated successfully, but these errors were encountered: