#8986 Image before Title still respects Title metadata - #9162
#8986 Image before Title still respects Title metadata#9162StephanMeijer wants to merge 4 commits into
Conversation
| ,Para [Strong [Str "No",Space,Str "table",Space,Str "of",Space,Str "figures",Space,Str "entries",Space,Str "found."]] | ||
| ,Header 1 ("introduction",[],[]) [Str "Introduction"] | ||
| ,Para [Str "Nothing",Space,Str "to",Space,Str "introduce,",Space,Str "yet."]] | ||
| Pandoc |
There was a problem hiding this comment.
Not sure what to do with this. It is entirely logical this is being converted to a Title (meta) so I would prefer letting that meaning just sit in there and maybe change the example.
There was a problem hiding this comment.
Can you explain more fully? Are you saying that the Title style is used for both the document title and the title of the table of contents section?
ff98b1b to
a87f67e
Compare
a87f67e to
05584c0
Compare
|
@jgm Feel free to review. Also asked my collegeau Paul to review. |
pkrijgsman
left a comment
There was a problem hiding this comment.
Looks great, this should be a fix for the issues that we have.
|
@jgm responded at #9170 (comment)
|
|
@jgm I changed the PR based on your feedback in my other PR. |
3a96df4 to
d20c61b
Compare
|
Actually, my suggestion was to replace all the "splitting" code with the simple behavior I mentioned. Was trying to make it simpler, not more complicated. |
|
@jgm I think I misunderstood what you mean then, as I implemented (I think) exactly what you described. Could you elaborate? |
| maybeToList :: Maybe a -> [a] | ||
| maybeToList Nothing = [] | ||
| maybeToList (Just x) = [x] |
There was a problem hiding this comment.
I think there's a function like this in Data.Maybe
|
I think you do implement what I suggested. But I guess I'd had in mind what might be a simpler approach. Instead of going through all the bp's and splitting them into metadata and non-metadata, I thought it would be simpler to simply keep a state variable for metadata and populate it as we go through the bp's, sequentially. Wouldn't that allow us to avoid all the splitting code at the beginning, while producing the same result? Let me know if that makes sense. |
|
@jgm it absolutely makes sense! |

The way I implemented this:
Then it's processed in this order:
a. First block of regular stuff
b. All empty paragraphs from within Meta
c. Second block of regular stuff
Our internal ID: NLDOC-837