简体   繁体   English

如何避免 NVDA 在电话号码中间宣布“链接”?

[英]How to avoid NVDA announcing “link” in the middle of a phone number?

I have a phone number with HTML as such:我有一个带有 HTML 的电话号码,如下所示:

<a aria-label="Call 1 8 0 0 5 5 5 1 2 1 2 for further questions" href="Tel:18005551212">1-800-555-1212</a>

It reads as intended for most screen readers, with one exception being NVDA, which reads something like "link Call 1 8 0 0 5 5 5 1 2 link 1 2 for further questions".对于大多数屏幕阅读器来说,它的读取方式与预期一致,但 NVDA 是一个例外,它的内容类似于“link Call 1 8 0 0 5 5 5 1 2 link 1 2 for more questions”。 The second "link" seems out of place there.第二个“链接”在那里似乎不合适。 What could be causing this and any possible suggestions for a fix?什么可能导致这种情况以及任何可能的修复建议?

I just tried your simple example with NVDA in both firefox and chrome and I didn't hear the second "link".我刚刚在 firefox 和 chrome 中使用 NVDA 尝试了您的简单示例,但我没有听到第二个“链接”。 Your code sample might be pared down from your original code which has the problem.您的代码示例可能是从有问题的原始代码中删减的。 Perhaps post a bigger sample from your original code.也许从您的原始代码中发布一个更大的样本。

As a side note, I understand the aria-label with the spaces between the numbers to force the screen reader to announce the phone as separate digits but that causes a problem for braille users.作为旁注,我理解带有数字之间空格的aria-label以强制屏幕阅读器将手机宣布为单独的数字,但这会给盲文用户带来问题。 They will read a bunch of spaces in the phone number and it will be more difficult to read.他们会阅读电话号码中的一堆空格,阅读起来会更加困难。 It's best to let the screen reader decide how to pronounce a phone number and then the user can adjust their settings to have it read in the style they want it.最好让屏幕阅读器决定如何发音一个电话号码,然后用户可以调整他们的设置,让它以他们想要的风格阅读。

When I try this with NVDA in both chrome and firefox, it reads the phone number like you'd expect.当我在 chrome 和 firefox 中使用 NVDA 尝试此操作时,它会按照您的预期读取电话号码。

<a aria-label="Call 1-800-555-1212 for further questions" href="Tel:18005551212">1-800-555-1212</a>

In fact, it reads it better than your example because there are slight pauses between "eight hundred" and "five five five" and "one two one two" because of the dashes.事实上,它比你的例子读起来更好,因为由于破折号,“八百”和“五五五”和“一二一二”之间有轻微的停顿。 In your example, I hear the string of digits as one long string with no brief pauses.在您的示例中,我将一串数字作为一个长字符串听到,没有短暂的停顿。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM