stevencohn/OneMore

Preview Markdown - Syntax highlighting (fenced code blocks)

Opened this issue · 4 comments

Problem to Solve

Fenced code blocks cause error.

To Reproduce

use the following text, and then preview it

```python
import sys
```

Expected Behavior

It is extended-syntax (https://www.markdownguide.org/extended-syntax/#fenced-code-blocks). Some will colorize it, like github; or ignore it.

Screenshots

image

Environment (if applicable)

  • OneNote Version: Office 2021 64bit
  • OneMore Version 6.4.0

Additional Context

Unable to reproduce. Do you have the log file? C:\Users\USERNAME\AppData\Local\Temp\OneMore.log

image-demo

I really want to update my OneNote version, but this is the latest version available in my channel.


04|03:19:22.912| Running command PreviewMarkdownCommand
04|03:19:22.939| Error running command PreviewMarkdownCommand
04|03:19:22.939| System.TypeLoadException
Message: Could not load type 'System.Numerics.Vector' from assembly 'System.Numerics.Vectors, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Source: System.Memory
StackTrace:    at System.SpanHelpers.SequenceEqual(Byte& first, Byte& second, NUInt length)
   at Markdig.Helpers.TransformedStringCache.EntryGroup.TryGet(ReadOnlySpan`1 inputSpan)
   at Markdig.Helpers.TransformedStringCache.Get(ReadOnlySpan`1 inputSpan)
   at Markdig.Parsers.FencedBlockParserBase`1.DefaultInfoParser(BlockProcessor state, StringSlice& line, IFencedBlock fenced, Char openingCharacter)
   at Markdig.Parsers.FencedBlockParserBase`1.TryOpen(BlockProcessor processor)
   at Markdig.Parsers.BlockProcessor.TryOpenBlocks(BlockParser[] parsers)
   at Markdig.Parsers.BlockProcessor.TryOpenBlocks()
   at Markdig.Parsers.BlockProcessor.ProcessLine(StringSlice newLine)
   at Markdig.Parsers.MarkdownParser.ProcessBlocks(BlockProcessor blockProcessor, String text)
   at Markdig.Parsers.MarkdownParser.Parse(String text, MarkdownPipeline pipeline, MarkdownParserContext context)
   at River.OneMoreAddIn.Commands.OneMoreDig.ConvertMarkdownToHtml(String path, String markdown)
   at River.OneMoreAddIn.Commands.PreviewMarkdownCommand.<Execute>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at River.OneMoreAddIn.CommandFactory.<Run>d__6.MoveNext()
TargetSite: [System.Memory] System.SpanHelpers::SequenceEqual()

Can you also try the following text:

  1. input the following two line (code and a tab)
    code
    <tab>

  2. Preview.

image

4|03:34:30.497| Running command PreviewMarkdownCommand
04|03:34:30.527| Error running command PreviewMarkdownCommand
04|03:34:30.527| System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: River.OneMoreAddIn
StackTrace:    at River.OneMoreAddIn.Models.PageEditor.IndentLevel(XElement element)
   at River.OneMoreAddIn.Models.PageEditor.<ExtractSnippets>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at River.OneMoreAddIn.Models.PageEditor.<ExtractSnippets>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at River.OneMoreAddIn.Models.PageEditor.<ExtractSelectedContent>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at River.OneMoreAddIn.Commands.PreviewMarkdownCommand.<Execute>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at River.OneMoreAddIn.CommandFactory.<Run>d__6.MoveNext()
TargetSite: [River.OneMoreAddIn] River.OneMoreAddIn.Models.PageEditor::IndentLevel()

Might be an installer problem. I'll have to check it next week.