Function
fromPosition
(
doc: EditorView["state"]["doc"],
position: { line: number; character: number },
)
Source from the content-addressed store, hash-verified
| 251 | } |
| 252 | |
| 253 | function fromPosition( |
| 254 | doc: EditorView["state"]["doc"], |
| 255 | position: { line: number; character: number }, |
| 256 | ): number { |
| 257 | const line = doc.line(position.line + 1); |
| 258 | return Math.min(line.to, line.from + position.character); |
| 259 | } |
| 260 | |
| 261 | function escapeHtml(value: string): string { |
| 262 | return value.replace(/[&<>"']/g, (match) => { |
Tested by
no test coverage detected