iamcco / iamcco/markdown-preview.nvim
need help on 'mkdp_browserfunc' with custom shell script
- Dominant language
- JavaScript
- Stars
- 8k
- Forks
- 411
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Can't make it works with a customized shell script in `LUA` setup
**To Reproduce**
Steps to reproduce the behavior:
1. Paste the following setting in Lua config file:
```lua
function open_preview_in_brave(url)
os.execute('/home/wison/my-shell/start_brave_browser.sh')
print(">>> my_markdown_preview >>> open_preview_in_brave | url: "..url)
end
-- Custom open browser function
-- vim.cmd 'let g:mkdp_browserfunc = \'/home/wison/my-shell/start_brave_browser.sh\''
vim.cmd 'let g:mkdp_browserfunc = \'open_preview_in_brave\''
```
3. Open `.md` file and run `:MarkDdownPreview` command
4. See error:
```lua
[markdown-preview.nvim] UnhandledRejection
Error: Vim:E117: Unknown function: open_preview_in_brave
```
**Expected behavior**
I think the `open_preview_in_brave` function should be call.
**Screenshots**
// Error in neovim

// I also added a little bit of debug code in `app/server.js` to print out the settings to a temp log file, `g:mkdp_browserfunc` has been set with the correct function value:

**Desktop (please complete the following information):**
- OS: Alpine Linux
Log:
```
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.