问题标签 [double-quotes]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
5 回答
4264 浏览

escaping - 从 WordPress 帖子中删除转义引号

<h3>在我的内容中,为了直接链接,我提供了我的标签 ID。

这是它在帖子编辑器中的外观:

这样我就可以像这样直接链接到它:

但是,双引号以某种方式被转义,帖子页面上的 HTML 输出如下所示:

这使得链接不起作用:(

我已经尝试了很多事情,例如从 the_content 中删除 wptexturize 过滤器,确保关闭了 magic_quotes,甚至remove_filter('content_save_pre', 'wp_filter_post_kses');这会极大地破坏事情。

我正在认真考虑创建一个过滤器来删除斜线,但似乎不应该从一开始就添加它们。例如,它们不会添加到带有 id 的图像中,因此必须将它们添加到某处。这发生在视觉和 HTML 模式中。

0 投票
1 回答
235 浏览

ruby - 报价问题(红宝石)

知道如何将正确的参数传递给 xpath 吗?必须有一些关于如何使用单引号/双引号的东西。当我使用变量时

parser_xpath_identificator = "'//table/tbody[@id=\"threadbits_forum_251\"]/tr'"给我一个不正确的值或

parser_xpath_identificator = "'//table/tbody[@id="threadbits_forum_251"]/tr'"给我一个错误语法错误,意外的 tIDENTIFIER,期待 $end

0 投票
1 回答
396 浏览

visual-studio-2008 - 如何让 VS2008 在智能感知产品周围放置双引号

我在 HTML 编辑器中(构建 ASP.NET MVC 视图)并编写 HTML。

编辑器对各种属性的智能感知很方便,但是当我选择 VS2008 提供的任何内容时,它从不在它们周围放置双引号,正如 HTML 所说的那样。

例如:

提供server,但是当我选择它时,我得到:

代替

这是某个地方的设置吗?

0 投票
2 回答
5762 浏览

c# - 使用 LINQ to XML 对 XML 元素内的双引号进行编码

我正在将一串 XML 解析成一个看起来像这样的 XDocument(使用 XDocument.Parse)

然后我稍微操作一下 XML,我想把它作为一个字符串发送回来,就像它进来一样

但是,我得到的是

请注意双引号现在是如何转义而不是编码的?

无论我使用,都会发生这种情况

或者

我怎样才能有双引号出来&quot;而不是\"

更新:也许这可以更好地解释它:

我从中得到的输出是:

我希望输出为:

0 投票
4 回答
5135 浏览

javascript - 如何安全地将 JS 字符串变量包装在双引号字符中?

显然,当您自己创建一个实际的字符串文字时,您自己会使用反斜杠转义双引号字符。

就像您使用少数其他控制字符一样,例如换行符和反斜杠。

但是,如果您只是将现有变量包装在引号字符中,即将其提供给需要引用输入的其他系统,则会出现一些混乱。

显然,您必须转义字符串中任何潜在的双引号字符。

但是根据某些人的说法,您现在必须担心在变量中转义文字反斜杠字符。换句话说,使用比我的小正则表达式大得多的锤子。但是我不明白为什么。

0 投票
6 回答
7900 浏览

windows - Administrator's shortcut to batch file with double quoted parameters

Take an excruciatingly simple batch file:

Save that as test.bat. Now, make a shortcut to test.bat. The shortcut runs the batch file, which prints "hi" and then waits for a keypress as expected. Now, add some argument to the target of the shortcut. Now you have a shortcut to:

The shortcut runs the batch file as before.

Now, run the shortcut as administrator. (This is on Windows 7 by the way.) You can use either right-click -> Run as Administrator, or go to the shortcut's properties and check the box in the advanced section. Tell UAC that it's okay and once again the shortcut runs the batch file as expected.

Now, change the arguments in the target of the shortcut to add double quotes:

Now try the shortcut as administrator. It doesn't work this time! A command window pops up and and disappears too fast to see any error. I tried adding > test.log 2>&1 to the shortcut, but no log is created in this case.

Try running the same shortcut (with the double quotes) but not as Administrator. It runs the batch file fine. So, it seems the behavior is not because of the double quoted parameters, and it's not because it's run as Administrator. It's some weird combination of the two.

I also tried running the same command from an administrator's command window. This ran the batch file as expected without error. Running the shortcut from the command window spawned a new command window which flashed and went away. So apparently the issue is caused by a combination of administrator, the shortcut, and the double quotes.

I'm totally stumped, does anyone have any idea what's going on? I'd also like a workaround.

0 投票
3 回答
2349 浏览

php - PHP mssql_query 双引号不能用

在 java-jdbc 中,我可以轻松运行以下 SQL(注意列和表名周围的双引号)


但是 PHP 中的相同查询错误地说语法无效

“警告:mssql_query() [function.mssql-query]:消息:'customer_id' 附近的语法不正确。(严重性 15)”

但如果删除所有双引号,查询工作正常,没有错误。

该查询是从 Java 应用程序移植的,所以我想保持双引号和 SQL 原样。任何替代解决方案?

谢谢尼莱什

Volkerk -- 解决方案(SET QUOTED_IDENTIFIER ON)

我做了以下

而且效果很好

非常感谢..

0 投票
2 回答
490 浏览

perl - 使用或不使用双引号时打印数组变量

当我学习打印数组变量时,我发现使用双引号时插入了空格。片段代码如下。你能告诉我为什么吗?

输出:

0 投票
6 回答
203124 浏览

excel - 如何插入双引号或单引号

我有一长串名字需要用引号括起来(可以是双引号或单引号),其中大约有 8,000 个。我在 Excel 中有它们没有任何引号,我可以复制所有名称并粘贴它们没有问题,但仍然没有引号。我一直在寻找一个 Excel 公式来为每行中的名称添加引号,但我没有运气。我也尝试了一些巧妙的查找和替换技术,但也没有奏效。我正在寻找的格式是这样的:

“艾伦”或“艾伦”

这些中的任何一个都可以。我需要这个,所以我可以将信息存储到数据库中。任何帮助是极大的赞赏。谢谢

PS:

我在网上发现其他人需要完成与我需要完成的相同的事情,并且此解决方案对他们有用,但我不知道如何处理它:

您可以通过使用范围变量(例如 myCell)来修复它,然后使用它来迭代范围对象的“选择”集合,如下所示

另一个对其他人也有效的解决方案是:

0 投票
1 回答
478 浏览

c# - 用双引号编写 MIME 文件

我正在手动创建一个多部分 MIME 格式的文件并将其提交到 SMTP 提取目录。当电子邮件到达我的收件箱时,它丢失了任何双引号条款的开头双引号。例如

变成

在将文件提交给 SMTP (PowerMTA) 之前,我已经检查了该文件,它确实包含所有正确的双引号等。

这里发生了什么,我如何围绕它编写代码?我的最终用户将使用此解决方案来创建基于 HTML 的出站电子邮件,因此它需要处理任何 HTML 内容。