mirror of
https://github.com/kovetskiy/mark.git
synced 2026-03-14 06:07:36 +08:00
feat: don't add redundant 'height' to images
This commit is contained in:
parent
ec6a718c76
commit
6f18a47ed0
@ -139,11 +139,11 @@ func (r *ConfluenceFencedCodeBlockRenderer) renderFencedCodeBlock(writer util.Bu
|
|||||||
return ast.WalkStop, err
|
return ast.WalkStop, err
|
||||||
}
|
}
|
||||||
r.Attachments.Attach(attachment)
|
r.Attachments.Attach(attachment)
|
||||||
|
|
||||||
effectiveAlign := calculateAlign(r.MarkConfig.ImageAlign, attachment.Width)
|
effectiveAlign := calculateAlign(r.MarkConfig.ImageAlign, attachment.Width)
|
||||||
effectiveLayout := calculateLayout(effectiveAlign, attachment.Width)
|
effectiveLayout := calculateLayout(effectiveAlign, attachment.Width)
|
||||||
displayWidth := calculateDisplayWidth(attachment.Width, effectiveLayout)
|
displayWidth := calculateDisplayWidth(attachment.Width, effectiveLayout)
|
||||||
|
|
||||||
err = r.Stdlib.Templates.ExecuteTemplate(
|
err = r.Stdlib.Templates.ExecuteTemplate(
|
||||||
writer,
|
writer,
|
||||||
"ac:image",
|
"ac:image",
|
||||||
@ -164,7 +164,7 @@ func (r *ConfluenceFencedCodeBlockRenderer) renderFencedCodeBlock(writer util.Bu
|
|||||||
attachment.Width,
|
attachment.Width,
|
||||||
attachment.Height,
|
attachment.Height,
|
||||||
displayWidth,
|
displayWidth,
|
||||||
attachment.Height,
|
"",
|
||||||
attachment.Name,
|
attachment.Name,
|
||||||
"",
|
"",
|
||||||
attachment.Filename,
|
attachment.Filename,
|
||||||
@ -183,11 +183,11 @@ func (r *ConfluenceFencedCodeBlockRenderer) renderFencedCodeBlock(writer util.Bu
|
|||||||
return ast.WalkStop, err
|
return ast.WalkStop, err
|
||||||
}
|
}
|
||||||
r.Attachments.Attach(attachment)
|
r.Attachments.Attach(attachment)
|
||||||
|
|
||||||
effectiveAlign := calculateAlign(r.MarkConfig.ImageAlign, attachment.Width)
|
effectiveAlign := calculateAlign(r.MarkConfig.ImageAlign, attachment.Width)
|
||||||
effectiveLayout := calculateLayout(effectiveAlign, attachment.Width)
|
effectiveLayout := calculateLayout(effectiveAlign, attachment.Width)
|
||||||
displayWidth := calculateDisplayWidth(attachment.Width, effectiveLayout)
|
displayWidth := calculateDisplayWidth(attachment.Width, effectiveLayout)
|
||||||
|
|
||||||
err = r.Stdlib.Templates.ExecuteTemplate(
|
err = r.Stdlib.Templates.ExecuteTemplate(
|
||||||
writer,
|
writer,
|
||||||
"ac:image",
|
"ac:image",
|
||||||
@ -208,7 +208,7 @@ func (r *ConfluenceFencedCodeBlockRenderer) renderFencedCodeBlock(writer util.Bu
|
|||||||
attachment.Width,
|
attachment.Width,
|
||||||
attachment.Height,
|
attachment.Height,
|
||||||
displayWidth,
|
displayWidth,
|
||||||
attachment.Height,
|
"",
|
||||||
attachment.Name,
|
attachment.Name,
|
||||||
"",
|
"",
|
||||||
attachment.Filename,
|
attachment.Filename,
|
||||||
|
|||||||
@ -170,7 +170,7 @@ func (r *ConfluenceImageRenderer) renderImage(writer util.BufWriter, source []by
|
|||||||
attachments[0].Width,
|
attachments[0].Width,
|
||||||
attachments[0].Height,
|
attachments[0].Height,
|
||||||
displayWidth,
|
displayWidth,
|
||||||
attachments[0].Height,
|
"",
|
||||||
string(n.Title),
|
string(n.Title),
|
||||||
string(nodeToHTMLText(n, source)),
|
string(nodeToHTMLText(n, source)),
|
||||||
attachments[0].Filename,
|
attachments[0].Filename,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user