Alignment links
This commit is contained in:
@@ -1288,6 +1288,28 @@ func TestWikiTemplateFormatsPreferredAlignments(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWikiTemplateFormatsPreferredAlignmentsWithConfiguredLinks(t *testing.T) {
|
||||
ctx := &wikiContext{alignmentLinkPattern: "Guides/Alignment/{alignment}"}
|
||||
page := wikiTemplatePage{
|
||||
PageID: "racialtypes:tiefling",
|
||||
Category: "racialtypes",
|
||||
Key: "racialtypes:tiefling",
|
||||
Title: "Tiefling",
|
||||
Row: map[string]any{
|
||||
"PreferredAlignments": map[string]any{"list": []any{"le", "ne", "ce"}},
|
||||
},
|
||||
}
|
||||
|
||||
got, err := ctx.renderWikiTemplateString("racialtypes.html", `{{alignments(PreferredAlignments)}}`, page)
|
||||
if err != nil {
|
||||
t.Fatalf("render template: %v", err)
|
||||
}
|
||||
want := "[[Guides/Alignment/Lawful_Evil|Lawful Evil]], [[Guides/Alignment/Neutral_Evil|Neutral Evil]], [[Guides/Alignment/Chaotic_Evil|Chaotic Evil]]"
|
||||
if got != want {
|
||||
t.Fatalf("expected %q, got %q", want, got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWikiTemplateDescriptionFiltersExtractParagraphsAndSections(t *testing.T) {
|
||||
ctx := &wikiContext{}
|
||||
page := wikiTemplatePage{
|
||||
|
||||
Reference in New Issue
Block a user