Text: Direct editing breaks with internal links

Created on 12 Nov 2020  路  3Comments  路  Source: nextcloud/text

image

bug

Most helpful comment

Hi there, this bug is easy to reproduce:

  • create a new markdown file
  • Type some text then use the nextcloud text editor to add an internal link by selecting the text and hitting the button 芦聽link to a file聽禄 and choose a NC file to link
  • Share the markdown file with a public link
  • Open the public link and the file preview will not render and the following error will be present in the JS console:
Failed to update steps in collaboration plugin TypeError: OCA.Viewer is undefined

(I commented here to add the text of the error in case some people search for it through a search engine)

All 3 comments

Hi there, this bug is easy to reproduce:

  • create a new markdown file
  • Type some text then use the nextcloud text editor to add an internal link by selecting the text and hitting the button 芦聽link to a file聽禄 and choose a NC file to link
  • Share the markdown file with a public link
  • Open the public link and the file preview will not render and the following error will be present in the JS console:
Failed to update steps in collaboration plugin TypeError: OCA.Viewer is undefined

(I commented here to add the text of the error in case some people search for it through a search engine)

I also ran into this issue. Unlike what the title suggests, for me it also breaks when viewing a markdown file through a read-only share link.

Looking at the generated HTML, it seems that the javascript file for the viewer app is not included in the page, which explains why OCA.Viewer is not available. Maybe there is a missing dependency in this app somewhere (not sure how this stuff works, though). It seems that when editing the markdown file through the regular edit interface (i.e. when logged in), the viewer app js is included in the <head> (maybe because some other app that is also used in this view does declare the dependency correctly or so?):

<script nonce="" defer="" src="/apps/viewer/js/viewer-main.js?v=855d4adb-3"></script>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

themedleb picture themedleb  路  6Comments

skjnldsv picture skjnldsv  路  3Comments

csantosb picture csantosb  路  5Comments

severin-lemaignan picture severin-lemaignan  路  4Comments

Klakla2 picture Klakla2  路  5Comments