2using System.Threading.Tasks;
35 int i = Language.IndexOf(
':');
37 Language = Language[..i].TrimEnd();
39 if (
string.Compare(Language,
"application/pdf",
true) == 0)
42 return Grade.NotAtAll;
52 if (Item.
ContentType.StartsWith(
"application/pdf") || Item.
Url.EndsWith(
".pdf"))
55 return Grade.NotAtAll;
78 this.document = Document;
92 int i = Language.IndexOf(
':');
96 Output.Append(
"<embed type=\"application/pdf\"");
97 Output.Append(
" style=\"margin-bottom:1em;width:100%;height:75vh;\"");
101 Output.Append(
" title=\"");
106 Output.Append(
" src=\"data:application/pdf;base64,");
108 foreach (
string Row
in Rows)
109 Output.Append(Row.Trim());
111 Output.AppendLine(
"\"/>");
113 return Task.FromResult(
true);
128 Output.Append(
"<embed type=\"application/pdf\"");
129 Output.Append(
" style=\"margin-bottom:1em;width:100%;height:75vh;\"");
130 Output.Append(
" src=\"");
138 Output.AppendLine(
"\">");
140 if (AloneInParagraph)
143 return Task.CompletedTask;
153 return Task.CompletedTask;
Contains a markdown document. This markdown document class supports original markdown,...
Abstract base class for multimedia content.
string ContentType
Content Type
Renders HTML from a Markdown document.
Abstract base class for Markdown renderers.
readonly StringBuilder Output
Renderer output.
Helps with common XML-related tasks.
static string HtmlValueEncode(string s)
Differs from Encode(String), in that it does not encode the aposotrophe or the quote.
static string HtmlAttributeEncode(string s)
Differs from Encode(String), in that it does not encode the aposotrophe.
Handles an embedded PDF document on a Markdown page.
Grade Supports(string Language)
Checks how well the handler supports multimedia content of a given type.
void Register(MarkdownDocument Document)
Is called on the object when an instance of the element has been created in a document.
Task RenderHtml(HtmlRenderer Renderer, MultimediaItem[] Items, ChunkedList< MarkdownElement > ChildNodes, bool AloneInParagraph, MarkdownDocument Document)
Generates HTML for the multimedia content.
EmbeddedPdfDocument()
Handles an embedded PDF document on a Markdown page.
Task< bool > RenderHtml(HtmlRenderer Renderer, string[] Rows, string Language, int Indent, MarkdownDocument Document)
Generates HTML for the code content.
override bool EmbedInlineLink(string Url)
If the link provided should be embedded in a multi-media construct automatically.
Task Preload(ICodecProgress Progress, MultimediaItem[] Items)
Reports a resource for preloading.
override Grade Supports(MultimediaItem Item)
Checks how well the handler supports multimedia content of a given type.
bool EvaluatesScript
If script is evaluated for this type of code block.
A chunked list is a linked list of chunks of objects of type T .
Interface for reporting progress about an encoding or decoding.
Interface for all markdown handlers of code content.
Interface for code content HTML renderers.
Interface for multimedia content HTML renderers.