aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/tohtml_spec.lua
diff options
context:
space:
mode:
authoraltermo <107814000+altermo@users.noreply.github.com>2025-03-10 17:15:41 +0100
committerGitHub <noreply@github.com>2025-03-10 09:15:41 -0700
commit67c39f5ecae0edc3777b2db0f7e637cafa097d05 (patch)
tree687aed2f2d6d9d9848be2b32c0e42a4a48348ac3 /test/functional/plugin/tohtml_spec.lua
parentc9b5ac113a4103956407165a7ebb2bba0c425e07 (diff)
downloadrneovim-67c39f5ecae0edc3777b2db0f7e637cafa097d05.tar.gz
rneovim-67c39f5ecae0edc3777b2db0f7e637cafa097d05.tar.bz2
rneovim-67c39f5ecae0edc3777b2db0f7e637cafa097d05.zip
fix(tohtml): disable modeline #32822
Problem: Running :TOhtml with a file containing modeline may generate an invalid modeline in the output. Solution: Add `<!-- vim: set nomodeline: -->` to the output. Use vi-compatible modeline format ("set foo:"), to avoid the trailing `-->` being treated as part of the modeline.
Diffstat (limited to 'test/functional/plugin/tohtml_spec.lua')
-rw-r--r--test/functional/plugin/tohtml_spec.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/functional/plugin/tohtml_spec.lua b/test/functional/plugin/tohtml_spec.lua
index afd4169006..0cc199609c 100644
--- a/test/functional/plugin/tohtml_spec.lua
+++ b/test/functional/plugin/tohtml_spec.lua
@@ -159,6 +159,7 @@ local function test_generates_html(guifont, expect_font)
local out_file = api.nvim_buf_get_name(api.nvim_get_current_buf())
eq({
+ '<!-- vim: set nomodeline: -->',
'<!DOCTYPE html>',
'<html>',
'<head>',
@@ -212,6 +213,7 @@ describe(':TOhtml', function()
n.command('2,2TOhtml')
local out_file = api.nvim_buf_get_name(api.nvim_get_current_buf())
eq({
+ '<!-- vim: set nomodeline: -->',
'<!DOCTYPE html>',
'<html>',
'<head>',