[HTML] Fix unclosed tags and inconsistencies

pull/321/head
Alexey Golub 5 years ago
parent 2a02894d64
commit 6a430cdc76

@ -48,6 +48,7 @@ img {
} }
.markdown { .markdown {
display: inline-block;
white-space: pre-wrap; white-space: pre-wrap;
line-height: 1.3; line-height: 1.3;
overflow-wrap: break-word; overflow-wrap: break-word;

@ -4,8 +4,8 @@
<head> <head>
{{~ # Metadata ~}} {{~ # Metadata ~}}
<title>{{ Context.Guild.Name | html.escape }} - {{ Context.Channel.Name | html.escape }}</title> <title>{{ Context.Guild.Name | html.escape }} - {{ Context.Channel.Name | html.escape }}</title>
<meta charset="utf-8" /> <meta charset="utf-8">
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width">
{{~ # Styles ~}} {{~ # Styles ~}}
<style> <style>
@ -58,7 +58,7 @@
{{~ # Preamble ~}} {{~ # Preamble ~}}
<div class="preamble"> <div class="preamble">
<div class="preamble__guild-icon-container"> <div class="preamble__guild-icon-container">
<img class="preamble__guild-icon" src="{{ Context.Guild.IconUrl }}" alt="Guild icon" /> <img class="preamble__guild-icon" src="{{ Context.Guild.IconUrl }}" alt="Guild icon">
</div> </div>
<div class="preamble__entries-container"> <div class="preamble__entries-container">
<div class="preamble__entry">{{ Context.Guild.Name | html.escape }}</div> <div class="preamble__entry">{{ Context.Guild.Name | html.escape }}</div>

@ -1,7 +1,7 @@
<div class="chatlog__message-group"> <div class="chatlog__message-group">
{{~ # Avatar ~}} {{~ # Avatar ~}}
<div class="chatlog__author-avatar-container"> <div class="chatlog__author-avatar-container">
<img class="chatlog__author-avatar" src="{{ MessageGroup.Author.AvatarUrl }}" alt="Avatar" /> <img class="chatlog__author-avatar" src="{{ MessageGroup.Author.AvatarUrl }}" alt="Avatar">
</div> </div>
<div class="chatlog__messages"> <div class="chatlog__messages">
{{~ # Author name and timestamp ~}} {{~ # Author name and timestamp ~}}
@ -20,7 +20,7 @@
{{~ # Content ~}} {{~ # Content ~}}
{{~ if message.Content ~}} {{~ if message.Content ~}}
<div class="chatlog__content"> <div class="chatlog__content">
<span class="markdown">{{ message.Content | FormatMarkdown }}</span> <div class="markdown">{{ message.Content | FormatMarkdown }}</div>
{{~ # Edited timestamp ~}} {{~ # Edited timestamp ~}}
{{~ if message.EditedTimestamp ~}} {{~ if message.EditedTimestamp ~}}
@ -37,7 +37,7 @@
<div class="spoiler spoiler--hidden" onclick="showSpoiler(event, this)"> <div class="spoiler spoiler--hidden" onclick="showSpoiler(event, this)">
<div class="spoiler-image"> <div class="spoiler-image">
<a href="{{ attachment.Url }}"> <a href="{{ attachment.Url }}">
<img class="chatlog__attachment-thumbnail" src="{{ attachment.Url }}" alt="Attachment" /> <img class="chatlog__attachment-thumbnail" src="{{ attachment.Url }}" alt="Attachment">
</a> </a>
</div> </div>
</div> </div>
@ -45,7 +45,7 @@
<a href="{{ attachment.Url }}"> <a href="{{ attachment.Url }}">
{{ # Non-spoiler image }} {{ # Non-spoiler image }}
{{~ if attachment.IsImage ~}} {{~ if attachment.IsImage ~}}
<img class="chatlog__attachment-thumbnail" src="{{ attachment.Url }}" alt="Attachment" /> <img class="chatlog__attachment-thumbnail" src="{{ attachment.Url }}" alt="Attachment">
{{~ # Non-image ~}} {{~ # Non-image ~}}
{{~ else ~}} {{~ else ~}}
Attachment: {{ attachment.FileName }} ({{ attachment.FileSize }}) Attachment: {{ attachment.FileName }} ({{ attachment.FileSize }})
@ -70,7 +70,7 @@
{{~ if embed.Author ~}} {{~ if embed.Author ~}}
<div class="chatlog__embed-author"> <div class="chatlog__embed-author">
{{~ if embed.Author.IconUrl ~}} {{~ if embed.Author.IconUrl ~}}
<img class="chatlog__embed-author-icon" src="{{ embed.Author.IconUrl }}" alt="Author icon" /> <img class="chatlog__embed-author-icon" src="{{ embed.Author.IconUrl }}" alt="Author icon">
{{~ end ~}} {{~ end ~}}
{{~ if embed.Author.Name ~}} {{~ if embed.Author.Name ~}}
@ -122,7 +122,7 @@
{{~ if embed.Thumbnail ~}} {{~ if embed.Thumbnail ~}}
<div class="chatlog__embed-thumbnail-container"> <div class="chatlog__embed-thumbnail-container">
<a class="chatlog__embed-thumbnail-link" href="{{ embed.Thumbnail.Url }}"> <a class="chatlog__embed-thumbnail-link" href="{{ embed.Thumbnail.Url }}">
<img class="chatlog__embed-thumbnail" src="{{ embed.Thumbnail.Url }}" alt="Thumbnail" /> <img class="chatlog__embed-thumbnail" src="{{ embed.Thumbnail.Url }}" alt="Thumbnail">
</a> </a>
</div> </div>
{{~ end ~}} {{~ end ~}}
@ -132,7 +132,7 @@
{{~ if embed.Image ~}} {{~ if embed.Image ~}}
<div class="chatlog__embed-image-container"> <div class="chatlog__embed-image-container">
<a class="chatlog__embed-image-link" href="{{ embed.Image.Url }}"> <a class="chatlog__embed-image-link" href="{{ embed.Image.Url }}">
<img class="chatlog__embed-image" src="{{ embed.Image.Url }}" alt="Image" /> <img class="chatlog__embed-image" src="{{ embed.Image.Url }}" alt="Image">
</a> </a>
</div> </div>
{{~ end ~}} {{~ end ~}}
@ -142,7 +142,7 @@
<div class="chatlog__embed-footer"> <div class="chatlog__embed-footer">
{{~ if embed.Footer ~}} {{~ if embed.Footer ~}}
{{~ if embed.Footer.Text && embed.Footer.IconUrl ~}} {{~ if embed.Footer.Text && embed.Footer.IconUrl ~}}
<img class="chatlog__embed-footer-icon" src="{{ embed.Footer.IconUrl }}" alt="Footer icon" /> <img class="chatlog__embed-footer-icon" src="{{ embed.Footer.IconUrl }}" alt="Footer icon">
{{~ end ~}} {{~ end ~}}
{{~ end ~}} {{~ end ~}}
@ -169,7 +169,7 @@
<div class="chatlog__reactions"> <div class="chatlog__reactions">
{{~ for reaction in message.Reactions ~}} {{~ for reaction in message.Reactions ~}}
<div class="chatlog__reaction"> <div class="chatlog__reaction">
<img class="emoji emoji--small" alt="{{ reaction.Emoji.Name }}" title="{{ reaction.Emoji.Name }}" src="{{ reaction.Emoji.ImageUrl }}" /> <img class="emoji emoji--small" alt="{{ reaction.Emoji.Name }}" title="{{ reaction.Emoji.Name }}" src="{{ reaction.Emoji.ImageUrl }}">
<span class="chatlog__reaction-count">{{ reaction.Count }}</span> <span class="chatlog__reaction-count">{{ reaction.Count }}</span>
</div> </div>
{{~ end ~}} {{~ end ~}}

@ -38,7 +38,7 @@ namespace DiscordChatExporter.Domain.Exporting.Writers.MarkdownVisitors
TextFormatting.Underline => ("<u>", "</u>"), TextFormatting.Underline => ("<u>", "</u>"),
TextFormatting.Strikethrough => ("<s>", "</s>"), TextFormatting.Strikethrough => ("<s>", "</s>"),
TextFormatting.Spoiler => ( TextFormatting.Spoiler => (
"<span class=\"spoiler spoiler--hidden\" onclick=\"showSpoiler(event, this)\"><span class=\"spoiler-text\">", "</span>"), "<span class=\"spoiler spoiler--hidden\" onclick=\"showSpoiler(event, this)\"><span class=\"spoiler-text\">", "</span></span>"),
TextFormatting.Quote => ("<div class=\"quote\">", "</div>"), TextFormatting.Quote => ("<div class=\"quote\">", "</div>"),
_ => throw new ArgumentOutOfRangeException(nameof(formatted.Formatting)) _ => throw new ArgumentOutOfRangeException(nameof(formatted.Formatting))
}; };
@ -129,7 +129,7 @@ namespace DiscordChatExporter.Domain.Exporting.Writers.MarkdownVisitors
var jumboClass = _isJumbo ? "emoji--large" : ""; var jumboClass = _isJumbo ? "emoji--large" : "";
_buffer _buffer
.Append($"<img class=\"emoji {jumboClass}\" alt=\"{emoji.Name}\" title=\"{emoji.Name}\" src=\"{emojiImageUrl}\" />"); .Append($"<img class=\"emoji {jumboClass}\" alt=\"{emoji.Name}\" title=\"{emoji.Name}\" src=\"{emojiImageUrl}\">");
return base.VisitEmoji(emoji); return base.VisitEmoji(emoji);
} }

Loading…
Cancel
Save