问题标签 [hyphenation]

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 投票
0 回答
1129 浏览

html - 谷歌浏览器:删除连字符

我有一个奇怪的问题:我有一个 Bootstrap 3/Wordpress 3.6.1 网站,中间有 3 个窄 - ~200px 宽 - 文本段落,不想要连字符。在 Safari 和 Firefox 中这很好,但在 Chrome(版本 30)中,文本会自动连字符。当我编写函数文件时,它不是 Wordpress 函数,而且我不认为这是引导程序 3 的事情,但只是为了确保我在 mixins 中将“连字符”设置为“无”

我试过在 CSS 中关闭它

当我搜索它时,我得到很多页面描述如何启用它,但没有描述如何禁用它。

0 投票
3 回答
7674 浏览

ios - 原生 iOS 应用程序中的断字

如何在 iOS 中激活自动断字?

我试图在 UILabel 的属性文本选项中将连字符因子设置为 1,但是我没有得到任何连字符。

0 投票
3 回答
540 浏览

javascript - 如何防止电子邮件地址的 CSS 自动断字

我对网站上的文本段落使用 CSS 连字符 ( hyphens:auto;)。有时,电子邮件地址会出现连字符,从而导致“错误”域名。例子:

john.doe@planungsteam.abc

变成

我将如何防止这种行为?由于这是用户生成的内容,因此无法手动添加 html 元素。我正在考虑使用 javascript 解析文本,向电子邮件地址添加特殊标签并hyphens:none;在这些标签上使用。但我担心性能。

(我认为这是一个问题,尤其是德语文本,其中有很多复合名词)

0 投票
2 回答
177 浏览

css - 未应用 CSS3 连字符

我正在尝试在我的文章中添加自动 CSS3 连字符。问题是标签似乎不影响文本。

我设置

...但什么也没有发生。

是我正在谈论的示例页面(顺便说一句,您不会在真实站点中看到上述 CSS,但我尝试使用 Firebug)。

0 投票
1 回答
1431 浏览

ios - 如何在 UITextView 中使用非英文文本启用连字符?

我使用paragraphStyle.hyphenationFactor = 1,但它仅适用于英文文本。如何UITextView使用非英文文本启用连字符或将语言环境设置为UITextView

0 投票
1 回答
393 浏览

css - Is there a pure-CSS hack to activate “text-align: justify” only if the browser supports “hyphens: auto”?

The browser support for hyphens: auto is still a bit lacking, even for English, but I would like to provide it already to my visitors using Firefox. If the browser does not support it, however, the gaps in the justified text are unseemly wide, and I would rather fall back on flush left alignment.

This is essentially what the CSS code looks like.

I’m aware of JavaScript libraries like Hyphenator.js that provide hyphenation for a range of browsers, but is there maybe a pure CSS solution for my simpler use case? I’ve come to think of hyphenation as less than essential on the web, unfortunately, and don’t want to embed a JavaScript library if there is a simpler fallback solution. Thanks!

0 投票
1 回答
168 浏览

css - 挂软连字符

我发现这篇关于悬挂标点符号的文章: http ://webdesign.tutsplus.com/articles/getting-the-hang-of-hanging-punctuation--cms-19890 和评论中的这个链接:http: //dabblet.com /gist/9623025

这是一个非常好的主意,它是挂起由Hyphenator或Hypher等工具生成的软连字符的绝佳方式。我开始玩 Hypher 并将连字符封装在一个跨度中......

然后我意识到我不知道如何设置软连字符的样式。

这段代码应该使连字符变成红色,但当然跨度中的那个不会破坏一个单词,所以浏览器不会显示它:

http://jsfiddle.net/5LazU/

有什么办法吗?

0 投票
4 回答
567 浏览

html - html按钮中的文本连字符

我有一个固定宽度的按钮。在此按钮中有一个<b>带有名称的标签。名称是可变的,它可以比按钮的宽度长。

在浏览器中查看时,较长的文本不适合按钮。有没有办法将按钮文本连字符?文本没有“空格”但下划线:“_”。

0 投票
0 回答
204 浏览

attributes - 聚合物:在模板中使用连字符的参数名称

聚合物元素的属性可以定义为attributes="toggle-foo",在聚合物定义中默认为 ,'toggle-foo':false并在聚合物定义中的其他地方使用,例如if( this['toggle-foo'] ){...}。如何在模板中使用带连字符的属性名称?

我尝试了以下方法:
<template if="{{toggle-foo}}">
<template if="{{this['toggle-foo']}}">
<template if="{{'toggle-foo'}}">

0 投票
2 回答
59 浏览

perl - 使用 Perl 删除单词连字符

我有这段文字:

如何将其转换为:

使用 perl