Sublime Forum

A links in minihtml

#1

I’m trying to add href links to my minihtml doc and I can figure out to pass params.

<a href='subl:my_test'>hi there</a>

works fine, but to pass params, the docs say

subl:command_name {"arg_name": arg_value, …}

But I can’t get this to work. I’ve tried <a href='subl:my_test{"p": "test"}'>hi there</a> with no luck. I must be thinking about this wrong.

0 Likes

#2

You need to escape the string quotes for the arguments. For example:

view.show_popup("<a href='subl:insert {\"characters\": \"test\"}'>hi there</a>")

Or use sublime.html_format_command or sublime.command_url, which will take care of that.

1 Like

#3

ok, thanks, using sublime.command_url worked great.

0 Likes

#4

I found the real issue. I need to use &quot; in place of the " if I don’t want to call sublime.command_url

0 Likes