Fix some edge cases; closes #3232
- Fixes wrong usage of AppURL - Fixes wrong rendering with extra path segments when AppSubURL is empty - Now also renders all links when 2+ permalinks are present
This commit is contained in:
parent
e4aa7bd511
commit
5b6b3f3fb3
3 changed files with 191 additions and 79 deletions
|
@ -1063,19 +1063,20 @@ func filePreviewPatternProcessor(ctx *RenderContext, node *html.Node) {
|
|||
return
|
||||
}
|
||||
|
||||
locale := translation.NewLocale("en-US")
|
||||
if ctx.Ctx != nil {
|
||||
ctxLocale, ok := ctx.Ctx.Value(translation.ContextKey).(translation.Locale)
|
||||
if ok {
|
||||
locale = ctxLocale
|
||||
}
|
||||
}
|
||||
|
||||
next := node.NextSibling
|
||||
for node != nil && node != next {
|
||||
locale := translation.NewLocale("en-US")
|
||||
if ctx.Ctx != nil {
|
||||
ctxLocale, ok := ctx.Ctx.Value(translation.ContextKey).(translation.Locale)
|
||||
if ok {
|
||||
locale = ctxLocale
|
||||
}
|
||||
}
|
||||
|
||||
preview := NewFilePreview(ctx, node, locale)
|
||||
if preview == nil {
|
||||
return
|
||||
node = node.NextSibling
|
||||
continue
|
||||
}
|
||||
|
||||
previewNode := preview.CreateHTML(locale)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue