-
-
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
#8986 Image before Title still respects Title metadata #9162
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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