private static void HandleToc(DocumentBuildContext context, SaveResult result)
{
if (result.TocMap?.Count > 0)
{
foreach (var toc in result.TocMap)
{
HashSet<string> list;
if (context.TocMap.TryGetValue(toc.Key, out list))
{
foreach (var item in toc.Value)
{
list.Add(item);
}
}
else
{
context.TocMap[toc.Key] = toc.Value;
}
}
}
}