files_markdown icon indicating copy to clipboard operation
files_markdown copied to clipboard

Using html tags

Open thesteff opened this issue 7 years ago • 8 comments

Hi !

I've tried to test the example code from your home page project but the html tags aren't previewed correctly. When I code this part : <h2 id="overview">Overview</h2> The preview panel shows <h2 id="overview">Overview</h2>

Is there a thing to config to make the preview panel interpret html or something else ? Thanks !

thesteff avatar Nov 05 '17 11:11 thesteff

Having a similar issue. I wanted to added a HTML link to open a website in a new window. Standard not supported by Markdown hence regular HTML. This does not work, i am routed to a non-existing page. Anything missing in my installation or something to configure or still a bug?

CasN avatar Nov 20 '17 19:11 CasN

Same as @thesteff. html tags are interpreted in plain text in the preview panel.

I am on nextcloud 12.0.3 (from wonderfall/nextcloud docker image) with Markdown Editor 2.0.1

cgrima avatar Dec 20 '17 18:12 cgrima

All html tags are displayed instead of interpreted. Versions are Nextcloud 13.0.0 and files_markdown 2.0.1

clorenz150 avatar Feb 12 '18 19:02 clorenz150

Here is a quick and dirty workaround to enable HTML tags in Notes v2.3.2.

WARNING: USE AT YOUR OWN RISK! Do it ONLY if you understand what you do. This is your decision to apply this workaround, not mine. I cannot be held responsible for any damage to your NextCloud installation.

I successfully tested it on my NextCloud 13 installation running on ArchLinux.

  • connect to your NextCloud server through SSH (or any appropriate way depending on your NextCloud installation)
  • go to the folder containing the files_markdown application (on my ArchLinux system, this is /usr/share/webapps/nextcloud/apps/files_markdown)
  • edit the js/Renderer.ts file and insert html:true, to line 79. You should get something like this:
78        this.md = new MarkdownIt({
79            html:true, // <= Do not forget the comma at the end of the line!
80            linkify: true
81        });
  • run the command npm install to install the tools required to rebuild the files_markdown app (it is expected that the npm command is installed on your NextCloud server. If not, it is up to you to know how to install it).
  • run the node_modules/.bin/webpack command to rebuild the app.
  • reload your Nextcloud session in your web browser. Enjoy!

Note that enabling HTML tags in markdown could be a security risk. Note also that this change will probably be lost as soon as you will update your Notes app to a new version.

EDIT: typo

gbcreation avatar Feb 17 '18 16:02 gbcreation

I'm glad @gbcreation posted a workaround, but I would really love to have this feature in the app without my intervention after every update.

Is there an ETA for this feature? I'm really missing that.

Just for now: @gbcreation is npm install absolutely necessary or is there another way without it?

Schmuuu avatar Jun 05 '18 12:06 Schmuuu

I'm not sure if I really want to have that feature. You can pass code that gets executed in so many ways and it's hard to catch them all. If this is provided, I think it should be an option that defaults to false.

simhnna avatar Jun 06 '18 22:06 simhnna

Would be nice to have this option as a parameter

Cancan68 avatar Jul 23 '19 08:07 Cancan68

I think this feature is still broken? It is still listed as a feature this provides though.

en3r0 avatar Jan 04 '20 15:01 en3r0