This commit is contained in:
Zel
2025-02-23 18:47:21 +08:00
parent eaaffeeccb
commit e46a7ca31c
104 changed files with 2630 additions and 2516 deletions

View File

@@ -4,18 +4,18 @@ using ZelWiki.Engine.Library.Interfaces;
namespace ZelWiki.Engine.Implementation
{
/// <summary>
/// Handles links the wiki to another site.
/// 处理链接
/// </summary>
public class ExternalLinkHandler : IExternalLinkHandler
{
/// <summary>
/// Handles an internal wiki link.
/// 处理内链
/// </summary>
/// <param name="state">Reference to the wiki state object</param>
/// <param name="link">The address of the external site being linked to.</param>
/// <param name="text">The text which should be show in the absence of an image.</param>
/// <param name="image">The image that should be shown.</param>
/// <param name="imageScale">The 0-100 image scale factor for the given image.</param>
/// <param name="state"></param>
/// <param name="link"></param>
/// <param name="text"></param>
/// <param name="image"></param>
/// <returns></returns>
public HandlerResult Handle(IZelEngineState state, string link, string? text, string? image)
{
if (string.IsNullOrEmpty(image))
@@ -25,13 +25,11 @@ namespace ZelWiki.Engine.Implementation
Instructions = [Constants.HandlerResultInstruction.DisallowNestedProcessing]
};
}
else
return new HandlerResult($"<a href=\"{link}\"><img src=\"{image}\" border =\"0\"></a>")
{
return new HandlerResult($"<a href=\"{link}\"><img src=\"{image}\" border =\"0\"></a>")
{
Instructions = [Constants.HandlerResultInstruction.DisallowNestedProcessing]
};
}
Instructions = [Constants.HandlerResultInstruction.DisallowNestedProcessing]
};
}
}
}
}