Skip to content

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

@ghost

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions