Bug 142938 - Clarify option to replace dashes
Summary: Clarify option to replace dashes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Heiko Tietze
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2021-06-19 07:50 UTC by Heiko Tietze
Modified: 2021-07-05 06:35 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2021-06-19 07:50:39 UTC
Both the replacement table (-- = –) as well as options (Replace dashes) under  AotoCorrect allows this replacement. Shall we drop one, eg the replacement table?
Comment 1 Regina Henschel 2021-06-20 00:10:42 UTC
The option "replace dashes" generates an unspaced EM-DASH (U+2014) as it is needed in English to offset parenthetical text.

The replacement table generates an EN-DASH (U+2013) and to trigger the replacement, you need to write a blank after the code, and that blank is not removed automatically.

So it is not duplicate and one of them cannot substitute the other.
Comment 2 Heiko Tietze 2021-06-21 05:33:29 UTC
Okay, thought so. Shall we rename / clarify the strings?
Comment 3 Regina Henschel 2021-06-21 12:01:39 UTC
(In reply to Heiko Tietze from comment #2)
> Okay, thought so. Shall we rename / clarify the strings?

Yes, in 'Options' dialog page for example
    Replace two dashes with unspaced EM-dash.

There exist already very long items in that dialog page, so the length should be not a problem.
Comment 4 László Németh 2021-06-23 09:57:55 UTC
(In reply to Regina Henschel from comment #3)
> (In reply to Heiko Tietze from comment #2)
> > Okay, thought so. Shall we rename / clarify the strings?
> 
> Yes, in 'Options' dialog page for example
>     Replace two dashes with unspaced EM-dash.
> 
> There exist already very long items in that dialog page, so the length
> should be not a problem.

This is language-dependent, e.g. in Finnish or in Hungarian, two dashes are replaced with an unspaced EN-dash.
Comment 5 Heiko Tietze 2021-06-23 11:07:39 UTC
Same discussion on Gerrit (https://gerrit.libreoffice.org/c/core/+/117585) and it leaves me puzzled how to deal with two very similar options. If the option works language dependent how about dropping the same/similar item from the replacement table?
Comment 6 Mike Kaganski 2021-06-29 09:32:38 UTC
(In reply to Regina Henschel from comment #1)
> The replacement table generates an EN-DASH (U+2013) and to trigger the
> replacement, you need to write a blank after the code, and that blank is not
> removed automatically.
> 
> So it is not duplicate and one of them cannot substitute the other.

Help [1] documents both (A, space, minus, space, B) and (A, space, minus, minus, space, B) as functions of the 'Replace Dashes' option, so it should be a superset of the replacement table's dash-related items. I'd just drop the replacement table elements.

[1] https://help.libreoffice.org/7.2/en-US/text/shared/01/06040100.html?System=WIN&DbPAR=WRITER&HID=cui/ui/applyautofmtpage/ApplyAutoFmtPage#hd_id3148473
Comment 7 Heiko Tietze 2021-06-29 14:46:54 UTC
We loose "-- " (without characters before/after) being replace by EN DASH and "--- " by EM DASH (if set in the replacement table). Easy to add back, though.
Comment 8 Olivier Hallot 2021-07-01 18:04:58 UTC
There is a situation where the em-dash as single character. It happens in novels dialogs:

----8<---
— Madame, sans doute, est un peu lasse ? on est si épouvantablement cahoté dans notre Hirondelle !
— Il est vrai, répondit Emma ; mais le dérangement m’amuse toujours ; j’aime à changer de place.
----8<---

How to insert a em-dash like above....
Comment 9 Heiko Tietze 2021-07-02 08:12:48 UTC
(In reply to Olivier Hallot from comment #8)
> How to insert a em-dash like above....

1--2, and remove the numbers. Eike suggested to keep the emoji style :--: and :---: option. I think it solves this use case.
Comment 10 Commit Notification 2021-07-05 06:35:56 UTC
Heiko Tietze committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7c1bad415ae48635dc67041c413bb7b76a530c22

Resolves tdf#142938 - Clarify option to replace dashes

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.