obsidian-repeat-plugin icon indicating copy to clipboard operation
obsidian-repeat-plugin copied to clipboard

Links inside rendered dataview blocks not clickable

Open prncc opened this issue 11 months ago • 2 comments

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 avatar Mar 25 '24 01:03 prncc

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 avatar Jul 21 '24 19:07 prncc

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.

prncc avatar Jul 21 '24 19:07 prncc