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

Extra space is inserted on links, now on <li> items (see also #147) #155

Closed
EuAndreh opened this issue Jul 14, 2021 · 7 comments · Fixed by #158
Closed

Extra space is inserted on links, now on <li> items (see also #147) #155

EuAndreh opened this issue Jul 14, 2021 · 7 comments · Fixed by #158
Assignees
Labels
bug Something isn't working

Comments

@EuAndreh
Copy link

I found a similar issue to #147 with links inside a <li>...</li> tag.

Sample interactive session:

$ pushd `mktemp -d`
/tmp/tmp.eumfknLzp8 ~/dev/libre/git-permalink
$ cat <<EOF > sample.md
> [paragraph link name](https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it)
>
> - [list item link name](https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it)
> EOF
$ md2po sample.md --po-filepath l.po --save
#
msgid ""
msgstr ""

#: sample.md:block 1 (paragraph)
msgid ""
"[paragraph link name](https://example.com/a-big-link-with-a-very-very-long-"
"and-big-url-name-on-it)"
msgstr ""

#: sample.md:block 2 (unordered list)
msgid ""
"[list item link name](https://example.com/a-big-link-with-a-very-very-long-"
"and-big-url-name-on-it)"
msgstr ""

$ po2md sample.md --pofiles l.po --save sample.l.md
$ cat sample.l.md
[paragraph link
name](https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it)

- [list item link name](https://example.com/a-big-link-with-a-very-very-long-
and-big-url-name-on-it)
$ pandoc -i sample.md -w html
<p><a href="https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it">paragraph link name</a></p>
<ul class="incremental">
<li><a href="https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it">list item link name</a></li>
</ul>
$ pandoc -i sample.l.md -w html
<p><a href="https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it">paragraph link name</a></p>
<ul class="incremental">
<li><a href="https://example.com/a-big-link-with-a-very-very-long-%20and-big-url-name-on-it">list item link name</a></li>
</ul>
$ md2po --version
.md2po-real 0.3.54
pushd `mktemp -d`

cat <<EOF > sample.md
[paragraph link name](https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it)

- [list item link name](https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it)
EOF

md2po sample.md --po-filepath l.po --save
po2md sample.md --pofiles l.po --save sample.l.md
cat sample.l.md
pandoc -i sample.md -w html
pandoc -i sample.l.md -w html
md2po --version

The generated pofile is equivalent, but reconstruction of it into the markdown
that seems to be failing.
I'm don't think this is intentational, so I came here to report back the issue.

I've only now encountered it, after using mdpo a bit more, with the
equivalent <p>...</p> issue fixed.

I'm not yet entirely sure how you prefer to handle these, and if you're OK with
me showing up every once in a while to point out a problem, and maybe try to
write the code to address it.

If so, I'm happy to keep doing it.
Otherwise, I'm also open to alternatives that suit you better.

@mondeja mondeja added the bug Something isn't working label Jul 14, 2021
@mondeja
Copy link
Owner

mondeja commented Jul 14, 2021

I'm not yet entirely sure how you prefer to handle these, and if you're OK with
me showing up every once in a while to point out a problem, and maybe try to
write the code to address it.

Thank you for the report. Any problem, keep reporting its really useful 👍🏼

@mondeja
Copy link
Owner

mondeja commented Jul 16, 2021

Fixed in v0.3.63.

@EuAndreh
Copy link
Author

EuAndreh commented Jul 16, 2021 via email

@EuAndreh
Copy link
Author

Hmm, a different issue came up, and it may be related: an extra <li> is added after the link when a - something is present.

Sample interactive session:

$ pushd `mktemp -d`
/tmp/tmp.BAOuydpVAf ~
$ echo '- [list item link name](https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it) - 2021-07-16' > sample.md
$ md2po sample.md --po-filepath l.po --save
#
msgid ""
msgstr ""

#: sample.md:block 1 (unordered list)
msgid ""
"[list item link name](https://example.com/a-big-link-with-a-very-very-long-"
"and-big-url-name-on-it) - 2021-07-16"
msgstr ""

$ po2md sample.md --pofiles l.po --save sample.l.md
$ cat sample.l.md
- [list item link name](https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it)
- 2021-07-16
$ md2po --version
.md2po-real 0.3.63
$

Extracted steps to reproduce:

pushd `mktemp -d`
echo '- [list item link name](https://example.com/a-big-link-with-a-very-very-long-and-big-url-name-on-it) - 2021-07-16' > sample.md
md2po sample.md --po-filepath l.po --save
po2md sample.md --pofiles l.po --save sample.l.md
cat sample.l.md
md2po --version

The generated pofile looks fine, the generation of the markdown that looks to be
the issue.

@EuAndreh
Copy link
Author

Should we file a new issue?

@mondeja
Copy link
Owner

mondeja commented Jul 16, 2021

Is not an issue, it is the expected behaviour. Is parsed as a list with one item, but the wrapping moves - 2021-07-16 to a new line. Could you check with --wrapwidth 999? You should see it in one line.

@EuAndreh
Copy link
Author

EuAndreh commented Jul 16, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants