Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape backslashes in JS written inside <script> tags #1776

Closed
ghost opened this issue Apr 16, 2020 · 2 comments
Closed

Escape backslashes in JS written inside <script> tags #1776

ghost opened this issue Apr 16, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 16, 2020

Same problem as #752

Result from CocInfo

versions

vim version: NVIM v0.5.0-436-ge8269a3ab
node version: v13.12.0
coc.nvim version: 0.0.78-312c7c4482
term: xterm-256color
platform: linux

Output channel: snippets

[Info 6:44:37 PM] Using ultisnips directories: UltiSnips /home/sensei/.config/coc/ultisnips
[Info 6:44:37 PM] Using ultisnips python command: pyx

Describe the bug

When opening function documentation in preview window for javascript code in <script> tags in a .html or .php file, escape backslashes are often displayed in the doHover window

Reproduce the bug

mini.vim:

set nocompatible
  set runtimepath^=/path/to/coc.nvim
  filetype plugin indent on
  syntax on
  set hidden

" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>

function! s:show_documentation()
  if (index(['vim','help'], &filetype) >= 0)
    execute 'h '.expand('<cword>')
  else 
    call CocAction('doHover')
  endif                                                                                 
endfunction

Open .php or .html tag, put functions in <script> tags, open function documentation, escape backslashes appear for most functions (NOT ALL)

Screenshots (optional)

Screenshot from 2020-04-16 18-54-56

@ghost ghost changed the title Escape backslashes in JS written inside <script> tagsw Escape backslashes in JS written inside <script> tags Apr 16, 2020
@chemzqm
Copy link
Member

chemzqm commented Apr 17, 2020

Should be problem of your language server, checkout https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

@chemzqm chemzqm closed this as completed Apr 17, 2020
@flw-cn
Copy link

flw-cn commented Sep 13, 2020

@alnj You can try Plug “flw-cn/vim-markdown” which is a fork for plasticboy/vim-markdown and it automatically hides the backslash. see PR preservim/vim-markdown#515 to see exactly what it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants