Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Commit 8210276

Browse files
author
Rudis Muiznieks
committed
better handling of scenes with empty titles
closes #5
1 parent dbfd02f commit 8210276

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Ficdown.Parser/Parser/StateResolver.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ private string ResolveAnchor(string blockName, int lineNumber, Anchor anchor, ID
5858
private string ResolveDescription(PageState page)
5959
{
6060
var resolved = new StringBuilder();
61-
resolved.AppendFormat("## {0}\n\n", page.Scene.Name);
61+
if(!string.IsNullOrEmpty(page.Scene.Name))
62+
resolved.AppendFormat("## {0}\n\n", page.Scene.Name);
6263

6364
var firstToggleCounter = 0;
6465
for (var i = 0; i < page.State.ActionsToShow.Count; i++)

Ficdown.Parser/Parser/Utilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private Anchor MatchToAnchor(Match match)
8888
{
8989
Original = !string.IsNullOrEmpty(astr) ? astr : null,
9090
Text = !string.IsNullOrEmpty(txstr) ? txstr : null,
91-
Title = !string.IsNullOrEmpty(ttstr) ? ttstr : null,
91+
Title = ttstr,
9292
Href = ParseHref(hrefstr)
9393
};
9494
}

0 commit comments

Comments
 (0)