-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Support Underline #6277
Support Underline #6277
Conversation
References #6255. |
Hey Vaibhav, how are you? Cool that you're contributing to pandoc! Some time off in Singapore? ;-) Just wanted to make sure you had seen my comment here: #5825 (comment) So while we all agree that the Cheers, |
Hi Mauro! It's great to hear from you 😄, you're right that I have some downtime and thought that this might be a good opportunity to contribute. It seems like the latest guidance is that |
I'm encountering a test failure that isn't making any sense to me:
Any idea what is going on here? |
don't know about the test failure... can't see how it could be whitespace...? but maybe have a look yourself, along the lines of:
|
Github has a useful feature for better handling of WIP pull requests called Draft PR's. You can create them as drafts when you open them or can now convert existing ones to drafts. This does a number of useful things and I suggest converting this to a Draft until it at least you as the submitter consider it ready for merging. PR reviews can happen during both phases. |
Thanks, I've made this a draft PR. @mb21 I tried to follow your instructions but wasn't sure what |
hm.. I cannot reproduce? I added this to stack.yaml
then
|
Oops, I forgot to push my latest changes. Can you try again? |
Okay, so the failing test is test/Tests/Writers/Docx.hs -> search for to see what's going on:
ha, indeed, your writer produces:
while the test says it should be:
Not sure why and which one is right, but that's why... |
Thanks for finding that! I think my changes to
For some reason part of the document is being parsed as |
well... I don't think pandoc does any kind of normalization on nestings of inline elements like strong/emph etc. but just preserves that, which is not perfect, but keeps the code simple:
so guess just do the same with Underline? |
Ah, thanks for clarifying that, I assumed that this was happening for the old |
I've regenerated
I think that if I'm able to fix this the PR should be ready to review.
|
Seems to work now! |
The CI tests are still failing... |
@jgm that's because this PR relies on jgm/pandoc-types#68 |
You can add something to stack.yaml and cabal.project telling it to use a particular commit from your PR. Indeed, pandoc currently has such a stanza because we're depending on some table changes. (You'll need to rebase your pandoc-types changes on top of the commit pandoc is currently depending on, and then change stack.yaml and cabal.project to point to your version.) |
Thanks, I did that and now all tests are passing except on macOS, where there is a GHC panic that I don't think I'm responsible for. |
My guess for why the error is occurring is that you are caching |
Can you say more about why caching |
I've just pushed a commit removing the caching of |
It might be partly superstition, but in the past I remember encountering weirdness in the way This is only a guess on my part, though, and I do understand that caching |
Hmm, this still seems to be happening without |
I tried building your branch locally on my macOS computer, and got the same error we get in CI. |
Unfortunately, this is a blocker. It's probably worth reporting it as a bug to ghc, as the message requests, since it's reproducible. |
For reference, here's the error I get on my machine:
One more idea: try incrementing the version number in your pandoc-types. Eventually the version will need to go to 1.21 because of API changes (underline, table), but if you change that you'd have to change texmath and other dependencies, so to keep it simple you could try 1.20.1. |
See the approach in Tests.Readers.HTML. Before running rt tests, we purify the AST by removing elements that can't round-trip. You could add something similar to the Muse tests. |
I took a closer look and learned that underlines are actually supported in Emacs Muse, so I updated the writer accordingly and this test run seems to be going much better. |
Is there anything further you need from me on this PR? |
It looks good on first glance; I just need to make time for a more careful review. |
For the record: switching back to master branch from this branch, couldn't build anymore either, got:
|
Probably worth reporting this as a bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good; thank you very much. I've made a few comments in the code.
What about the readers, though? This only changes the writers. It would be good to support the readers too; otherwise we'll never actually get Underline elements to render!
In the case of Markdown I think that [span]{.ul}
should go to Underline.
Most of the readers were already generating |
Oh right, you handle the readers already via the change to underlineSpan. I'd missed that. |
Otherwise this is looking good. I'll go ahead and merge the pandoc-types changes, and then you can also change to depend on master in pandoc-types. |
Updated, thanks! |
Thanks! |
I'm looking into converting HTML with underlines to RTF and got here. It doesn't seem to work or at least nothing is underlined when I open the output files in LibreOffice. This is using the |
Note that this change has been merged into master but it's not yet in any released version. However, in all likelihood we just haven't supported underline yet in RTF. If you can confirm that (using a nightly) then please submit a new issue for that. |
Ah, I see -- |
Great, thank you! |
Done |
Adds Underline() object. Markdown text set as [here]{.ul} will be underlined See: jgm/pandoc#6277
This PR depends on jgm/pandoc-types#68.