HTML 模板文件的 Eclipse HTML 编辑器

发布于 2024-08-04 12:58:00 字数 558 浏览 2 评论 0原文

我正在尝试使用包含 Web 开发工具的 Eclipse Ganymedes 版本 3.4.1 编辑 phpbb HTML 模板文件。

这些模板文件包含带有模板变量标记的 HTML 标记,格式为 {variable_name}。现在,当尝试打开此类文件时,Eclipse 也会尝试验证这些模板变量标记。

例如,模板包含

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" /> 

打开 Eclipse 后在编辑器主体上显示:

Unsupported Character Body
Character encoding "{S_CONTENT_ENCODING}" is not supported by this platform.
<button>Set encoding...</button>

如何使用 WTP 解决此问题,或者是否有更好的编辑器用于模板编辑目的?

I'm trying to edit phpbb HTML template file with Eclipse Ganymedes version 3.4.1 containing Web Developer Tools.

These template files contain HTML markup with template variable marks in form {variable_name}. Now, when trying to open such file, Eclipse trys to validate also these template variable marks.

For example template contains

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" /> 

After opening Eclipse shows on editor body:

Unsupported Character Body
Character encoding "{S_CONTENT_ENCODING}" is not supported by this platform.
<button>Set encoding...</button>

How to solve this using WTP or is there any better editor for template editing purpose ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北城半夏 2024-08-11 12:58:00

Eclipse 尝试根据元标记确定文本编码,但失败。

要覆盖此行为,请在 Eclipse 中打开文件,以便您可以看到错误。打开“文件”菜单并选择“属性”(Alt-Enter),Eclipse 将显示文件的属性对话框,您可以在其中更改文本文件编码。

我不知道是否可以对所有文件禁用此功能。

Eclipse is trying to determine the text encoding from your meta tags and fails.

To override this behavior open the file in eclipse so you can see the error. Open the File menu and choose Properties (Alt-Enter) and eclipse will show you the properties dialog for the file where you can change the text file encoding.

I don't know if this can be disabled for all the files.

内心激荡 2024-08-11 12:58:00

我从未在 Linux 上使用过 Eclipse,但看起来问题并不在于 Eclipse 支持变量,而在于它试图渲染它认为称为“{S_CONTENT_ENCODING}”

您可以通过将所有的 {S_CONTENT_ENCODING} 更改为 utf-8 (或 latin-1 或其他)来解决该问题你的模板。 (这假设您没有将编码从一个模板更改为下一个模板,但我真的怀疑您是否这样做。)

复制粘贴 utf-8 到您看到 {S_CONTENT_ENCODING} 的位置> 在其中一个模板中,Eclipse 应该处理其中的其他 {foo} 实例。

I've never used Eclipse on Linux, but it looks like the problem isn't really about Eclipse supporting variables -- it's about it trying to render what a character set that it thinks is called "{S_CONTENT_ENCODING}"

You can probably get around the problem by changing {S_CONTENT_ENCODING} to utf-8 (or latin-1 or whatever) in all of your templates. (This assumes that you aren't changing encoding from one template to the next, but I really doubt you are.)

Copy-paste utf-8 where you see {S_CONTENT_ENCODING} in one of the templates, and Eclipse should handle it the other {foo} instances from there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文