Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/testing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ The files in this directory are used for testing purposes. Do not edit these fil
{
"key": "value"
}
```
```
9 changes: 7 additions & 2 deletions src/Elastic.Markdown/Assets/markdown/code.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
}
}

pre code .code-callout .hljs-number {
pre code .code-callout {
@apply ml-1;
transform: translateY(-1px);
user-select: none;
}
Expand All @@ -47,8 +48,12 @@
left: calc(-1 * var(--spacing) * 6);
}
}

pre code .code-callout .hljs-number {
@apply text-white!;
}

pre code .code-callout .hljs-number,
pre code .code-callout,
ol.code-callouts li::before {
@apply text-xs!
text-white!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private static List<CallOut> EnumerateAnnotations(Regex.ValueMatchEnumerator mat

private static CallOut? ParseMagicCallout(ValueMatch match, ref ReadOnlySpan<char> span, ref int callOutIndex, int originatingLine)
{
var startIndex = Math.Max(span.LastIndexOf("//"), span.LastIndexOf('#'));
var startIndex = Math.Max(span.LastIndexOf(" // "), span.LastIndexOf('#'));
if (startIndex <= 0)
return null;

Expand All @@ -248,7 +248,7 @@ private static List<CallOut> EnumerateAnnotations(Regex.ValueMatchEnumerator mat
return new CallOut
{
Index = callOutIndex,
Text = callout.TrimStart('/').TrimStart('#').TrimStart().ToString(),
Text = callout.TrimStart().TrimStart('/').TrimStart('#').TrimStart().ToString(),
InlineCodeAnnotation = true,
SliceStart = startIndex,
Line = originatingLine,
Expand All @@ -257,7 +257,7 @@ private static List<CallOut> EnumerateAnnotations(Regex.ValueMatchEnumerator mat

private static List<CallOut> ParseClassicCallOuts(ValueMatch match, ref ReadOnlySpan<char> span, ref int callOutIndex, int originatingLine)
{
var indexOfLastComment = Math.Max(span.LastIndexOf('#'), span.LastIndexOf("//"));
var indexOfLastComment = Math.Max(span.LastIndexOf('#'), span.LastIndexOf(" // "));
var startIndex = span.LastIndexOf('<');
if (startIndex <= 0)
return [];
Expand Down
Loading