Skip to content
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

Extract each bullet point in Markdown nested bullet lists into its own string #131

Closed
intrigeri opened this issue Jun 17, 2018 · 9 comments · Fixed by #244
Closed

Extract each bullet point in Markdown nested bullet lists into its own string #131

intrigeri opened this issue Jun 17, 2018 · 9 comments · Fixed by #244

Comments

@intrigeri
Copy link

A few months ago I've mentioned "(vague) plans for other improvements in Markdown bullet list handling" I've mentioned a few months ago on #7 (comment). The design discussion there was resolved and #7 was rightfully closed so it's time to follow-up with this.

Single-level Markdown bullet lists are handled properly but as soon as one adds a second, nested level, string extraction starts to get suboptimal. Our translators at Tails have complained about the additional work it causes for them e.g. when strings become fuzzy.

I've pushed a test case to https://github.com/intrigeri/po4a/tree/mdwn-nested-bullet-lists that demonstrates the problem.

toddy15 added a commit that referenced this issue Jun 17, 2018
This will address github's issue #131.
@toddy15
Copy link
Collaborator

toddy15 commented Jun 17, 2018

Ah, I see. Thanks for the follow-up, I've added a testcase for this.

@intrigeri
Copy link
Author

@toddy15 AFAICT the test case you added demonstrates that the current code indeed has the bug this ticket is about, i.e. "Nested item 1" and "Nested item 2" are not extracted into their own string. So I'm not surprised it passes. While the test case I've proposed instead fails, in order demonstrate that the code does not behave as it should. So I believe that "This will address github's issue #131" is incorrect: commit 5658ace does not address this issue, it merely confirms it in its own way. Are we on the same page?

@toddy15
Copy link
Collaborator

toddy15 commented Jul 1, 2018

Yes, we are on the same page. The commit message is a bit misleading, I admit. What I meant was that this will address the issue, not that it solved the issue. However, adding a test case that fails would render the Travis CI useless, so I didn't do it.

It might be better to create a test case with the expected output but disable the specific test for now.

@intrigeri
Copy link
Author

intrigeri commented Jul 1, 2018 via email

@toddy15
Copy link
Collaborator

toddy15 commented Jul 1, 2018

The test is now failing as expected, but the testsuite still passes because it's marked as TODO. Quite a nice feature of Test::More.

@bexelbie
Copy link
Collaborator

bexelbie commented Oct 2, 2018

I've recently fixed a similar bug in Asciidoc, #149, that is still pending PR. I wonder if a similar patch would work for markdown.

@eighthave
Copy link
Contributor

This seems to be solved in 0.57 at least. I'm seeing these metadata entries in the .po files:

  • #. type: Bullet: ' - '
  • #. type: Bullet: ' * '
  • #. type: Bullet: ' * '
  • #. type: Bullet: '* '

@intrigeri
Copy link
Author

intrigeri commented Mar 21, 2020 via email

@mquinson
Copy link
Owner

Here is another regex-based parser of Markdown. We may find some interesting bits in there: https://github.com/microsoft/vscode-markdown-tm-grammar/blob/master/markdown.tmLanguage.base.yaml

terceiro added a commit to terceiro/po4a that referenced this issue May 31, 2020
terceiro added a commit to terceiro/po4a that referenced this issue May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants