prncc / obsidian-repeat-plugin

Review notes using periodic or spaced repetition.
MIT License
41 stars 2 forks source link

Links inside rendered dataview blocks not clickable #33

Open prncc opened 5 months ago

prncc commented 5 months ago

For example,

```dataview
LIST FROM [[Some Note]]
\```

Generates a list of links, but the links are not clickable inside the repeat view. Should check if this is fixable.

prncc commented 1 month ago

This is what the elements look like. First one from within the dataview-rendered block, the second a working processed vanilla link

<div class="markdown-preview-sizer markdown-preview-section">
  <div class="block-language-dataview node-insert-event" dir="auto" style="overflow-x: auto;">
    <ul class="dataview list-view-ul">
      <li><span><a data-tooltip-position="top" aria-label="Box/My Note.md"
            data-href="Box/My Note.md" href="Box/My Note.md"
            class="internal-link" target="_blank" rel="noopener">My Note</a></span></li>
    </ul>
  </div>
  <p dir="auto">

    <a data-href="My Note"
      href="obsidian://open?vault=Vault&amp;file=My%20Note" class="internal-link"
      target="_blank" rel="noopener">My Note</a>
  </p>
</div>

The issue is happening because just calling MarkdownPreviewView.renderMarkdown doesn't handle dynamic dataview blocks, so the plugin's renderMarkdown function doesn't have anything to fix links for.

MarkdownPreviewView.renderMarkdown is deprecated. Maybe its successor doesn't have this issue.

prncc commented 1 month ago

I replaced https://docs.obsidian.md/Reference/TypeScript+API/MarkdownRenderer/renderMarkdown with https://docs.obsidian.md/Reference/TypeScript+API/MarkdownRenderer/render and the issue persists with the latest Dataview version.