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

Other Markdown FrontMatter parse problem when generating ePub (stringify issue?) #8095

Open
hoijui opened this issue Jun 1, 2022 · 3 comments

Comments

@hoijui
Copy link

hoijui commented Jun 1, 2022

Multi-line title with ![](image)\n\nText is not recognized with -t epub,
but is successfully parsed and used when generating Latex/PDF.

(a continuation of issue #8091)

pandoc 2.18 on debian testing

testing script:

#!/bin/sh

pandoc --version

echo
echo "ePub out -This prints a warning:"
# [WARNING] This document format requires a nonempty <title> element.
echo '---
title: |
  [![sample logo](https://i.imgur.com/I86rTVl.jpg){width=4cm}](#attributions)

  bla
---
' | pandoc -t epub -o /dev/null

echo
echo "ePub out (no sep.) - This works fine (No warning):"
echo '---
title: |
  [![sample logo](https://i.imgur.com/I86rTVl.jpg){width=4cm}](#attributions)
  bla
---
' | pandoc -t epub -o /dev/null

echo
echo "PDF out - This works fine (No warning):"
echo '---
title: |
  [![sample logo](https://i.imgur.com/I86rTVl.jpg){width=4cm}](#attributions)

  bla
---
' | pandoc -t pdf -o /dev/null

output:

pandoc 2.18
Compiled with pandoc-types 1.22.2, texmath 0.12.5, skylighting 0.12.3,
citeproc 0.7, ipynb 0.2, hslua 2.2.0
Scripting engine: Lua 5.4
User data directory: /home/user/.pandoc
Copyright (C) 2006-2022 John MacFarlane. Web:  https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

ePub out -This prints a warning:
[WARNING] This document format requires a nonempty <title> element.
  Defaulting to '-' as the title.
  To specify a title, use 'title' in metadata or --metadata title="...".

ePub out (no sep.) - This works fine (No warning):

PDF out - This works fine (No warning):
@jgm
Copy link
Owner

jgm commented Jun 2, 2022

I'm curious what you think the title should look like when it contains multiple paragraphs. If we applied stringify as we do with PDF output, we wouldn't get a warning, but I don't think it would look as you intend, since the contents would be smushed together.

@hoijui
Copy link
Author

hoijui commented Jun 3, 2022

Well in my case, there would be only a single line of text (if images are removed).
Also this case - image plus one line of text (with a separating line, as Markdown requires that to create a new-line) - is a common one. I agree though, that it would not work in the general case, if people use multiple lines of text. Then it is a question whether it should use only the first line of text, or smush them all together, or create a warning/error.
what do you think?

@jgm
Copy link
Owner

jgm commented Jun 3, 2022

A blank line in Markdown creates a new paragraph. If you just want a hard line break in the same paragraph, use two spaces + newline or backslash + newline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants