ColdFusion 中的 Wrap 功能是否插入 CR/LF?

发布于 2024-08-31 18:10:23 字数 310 浏览 3 评论 0原文

我需要进行一些自动换行,但需要考虑一些因素:

  1. 源文件是 MS WORD

  2. 将文本复制并粘贴到 cfform 中的文本区域中。

  3. 使用

    #wrap(theTextVar,80)#
    转储文本 80 个字符

  4. 文本已上传到需要上传 ansi 或 ascii 字符的旧系统。

一切似乎都正常,我只是想确认是否有其他人有幸这样做,以及他们是否知道在输出文本中的每一行之后是否输入了 CR / LF (步骤 3)?

I have the need to do some word wrapping with a few considerations:

  1. Source file is MS WORD

  2. Copy and paste the text into a textarea in a cfform.

  3. Use

    #wrap(theTextVar,80)#

    to dump out the text 80 characters

  4. The text is uploaded to a legacy system which needs ansi or ascii chars uploaded.

Everything seems to work okay, I just wanted to confirm see if anyone else has had luck doing this and if they know if a CR / LF is entered after each line in the outputted text (Step 3)?

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

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

发布评论

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

评论(2

才能让你更想念 2024-09-07 18:10:23

来自wrap()的文档:

使用特定于操作系统的
换行符:UNIX 的换行符、回车符
Windows 上的回车符和换行符。

因此,如果您在 Windows 机器上执行此操作,那么答案是肯定的。

From the docs on wrap():

Uses the operating-system specific
line break: newline for UNIX, carriage
return and newline on Windows.

So if you are doing this on a Windows box, then the answer is yes.

落花浅忆 2024-09-07 18:10:23

试过这个吗?

<cffile action="write" file="i_will_show_the_secret_if_you_open_me_in_text_editor.html" output="#wrap(theTextVar,80)#" />

Tried this?

<cffile action="write" file="i_will_show_the_secret_if_you_open_me_in_text_editor.html" output="#wrap(theTextVar,80)#" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文