mirror of
https://github.com/kovetskiy/mark.git
synced 2026-04-21 05:42:35 +00:00
feat: align image rendering with Confluence default
This commit is contained in:
committed by
Manuel Rüger
parent
4d887bde74
commit
cbc7400f92
@@ -141,22 +141,30 @@ func (r *ConfluenceFencedCodeBlockRenderer) renderFencedCodeBlock(writer util.Bu
|
||||
r.Attachments.Attach(attachment)
|
||||
|
||||
effectiveAlign := calculateAlign(r.MarkConfig.ImageAlign, attachment.Width)
|
||||
effectiveLayout := calculateLayout(effectiveAlign, attachment.Width)
|
||||
displayWidth := calculateDisplayWidth(attachment.Width, effectiveLayout)
|
||||
|
||||
err = r.Stdlib.Templates.ExecuteTemplate(
|
||||
writer,
|
||||
"ac:image",
|
||||
struct {
|
||||
Align string
|
||||
Width string
|
||||
Height string
|
||||
Title string
|
||||
Alt string
|
||||
Attachment string
|
||||
Url string
|
||||
Align string
|
||||
Layout string
|
||||
OriginalWidth string
|
||||
OriginalHeight string
|
||||
Width string
|
||||
Height string
|
||||
Title string
|
||||
Alt string
|
||||
Attachment string
|
||||
Url string
|
||||
}{
|
||||
effectiveAlign,
|
||||
effectiveLayout,
|
||||
attachment.Width,
|
||||
attachment.Height,
|
||||
displayWidth,
|
||||
attachment.Height,
|
||||
attachment.Name,
|
||||
"",
|
||||
attachment.Filename,
|
||||
@@ -177,22 +185,30 @@ func (r *ConfluenceFencedCodeBlockRenderer) renderFencedCodeBlock(writer util.Bu
|
||||
r.Attachments.Attach(attachment)
|
||||
|
||||
effectiveAlign := calculateAlign(r.MarkConfig.ImageAlign, attachment.Width)
|
||||
effectiveLayout := calculateLayout(effectiveAlign, attachment.Width)
|
||||
displayWidth := calculateDisplayWidth(attachment.Width, effectiveLayout)
|
||||
|
||||
err = r.Stdlib.Templates.ExecuteTemplate(
|
||||
writer,
|
||||
"ac:image",
|
||||
struct {
|
||||
Align string
|
||||
Width string
|
||||
Height string
|
||||
Title string
|
||||
Alt string
|
||||
Attachment string
|
||||
Url string
|
||||
Align string
|
||||
Layout string
|
||||
OriginalWidth string
|
||||
OriginalHeight string
|
||||
Width string
|
||||
Height string
|
||||
Title string
|
||||
Alt string
|
||||
Attachment string
|
||||
Url string
|
||||
}{
|
||||
effectiveAlign,
|
||||
effectiveLayout,
|
||||
attachment.Width,
|
||||
attachment.Height,
|
||||
displayWidth,
|
||||
attachment.Height,
|
||||
attachment.Name,
|
||||
"",
|
||||
attachment.Filename,
|
||||
|
||||
Reference in New Issue
Block a user