Description: Feature request: In Writer, there is an AutoCorrect option that can turn https:// urls automatically into hyperlinks. In science, e.g. when using Zotero, it is very common to cite papers with the format doi:10.1259/bjr.20190594 It would be really great if there is a further option in the AutoCorrect menu, called "DOI recognition", which adds behind the scenes a hyperlink to https://doi.org/10.1259/bjr.20190594 (without changing the text itself). Steps to Reproduce: 1. Write doi:10.1259/bjr.20190594 2. Select text and click Tools, AutoCorrect, Apply Actual Results: Nothing happens Expected Results: Hyperlink is inserted https://doi.org/10.1259/bjr.20190594 if a checkbox "DOI recognition" is activated in Tools, AutoCorrect, Autocorrect Options, no Reproducible: Always User Profile Reset: No Additional Info: Related issues: https://forums.zotero.org/discussion/65658/bibliography-in-libreoffice-clickable-doi https://forums.zotero.org/discussion/76312/csl-style-with-doi-hyperlinks https://forums.zotero.org/discussion/71519/doi-does-not-appear-as-a-link https://forums.zotero.org/discussion/7534/hyperlinking-citations-to-bibliography-in-openoffice https://ask.libreoffice.org/t/how-may-i-do-writer-recognize-hyperlinks-automatically/1860/4 Version: 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.10 CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3; Locale: en-US (en_US.UTF-8); Calc: group
This could be a nice macro or extension that someone writes, but I don't think it should be a core feature. It's too narrow of a use case. What if DOI changes how they link things? What if someone wants their DOI references linked to somewhere else? Generalizing this request to something that attempts to match a user-supplied pattern and automatically runs a user-supplied macro on that match automatically in the background might be a little more defensible as a core feature, but even then I would say adding that feature is a low priority.
(In reply to Michael Warner from comment #1) I supprt this feature request > This could be a nice macro or extension that someone writes, but I don't > think it should be a core feature. It's too narrow of a use case. What if > DOI changes how they link things? Could be a question for every hyperlink. And basic idea of the DOI-concept is, that hyperlink is stable. > What if someone wants their DOI references > linked to somewhere else? I'm not sure, how familiar you are with DOI. But it is a reference and if you use it, you don't want to link somewhere else. cc: Design-Team for further input and decision
Yes, the DOI (ISO 26324) is by its nature stable (and the Publisher of the DOI is responsible for maintaining linkage to its related resource). Adding an LO autocorrection to parse and convert a DOI formatted tag (i.e. the reference string prepended with "doi:") into a valid URI is reasonable enhancement to core. +1 to implement, and recognize its usefulness to context of see also bug 121945
@Lásló, your opinion of an autocorrect function and vcl handling for this?
Some agreement here, and I just wonder if we need the leading "http://". Typing the last letter would add it before "doi:" making the text jumping. The hyperlink can have a different link and include the protocol. Sounds like an interesting task and I'd start at editeng/source/misc/acorrcfg.cxx SetInetAttribute, and editeng/source/editeng/edtspell.cxx EdtAutoCorrDoc::SetINetAttr().
Start working on this.
I've submitted a patch to: https://gerrit.libreoffice.org/c/core/+/150954 Can anyone review it?
Baole Fang committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a772976f047882918d5386a3ef9226c4aa2aa118 tdf#145925: Add DOI recognition It will be available in 7.6.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.
Not working with doi:10.1259/bjr.20190594. The setting is activated in Tools - Autocorrect - Autocorrect Options. Nothing happened. Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: a772976f047882918d5386a3ef9226c4aa2aa118 CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3 Locale: ro-RO (ro_RO.UTF-8); UI: en-US Calc: threaded
Created attachment 186968 [details] video testing the bug
(In reply to BogdanB from comment #10) > Created attachment 186968 [details] > video testing the bug Hi, this is caused by the other bug I mentioned in bug 155018, which is a duplicate of bug 128192 and also related to bug 90507. Notice that your style is currently "Text Body", where Tools/AutoCorrect/Apply only works for default style without my patch: https://gerrit.libreoffice.org/c/core/+/151008.
Created attachment 186969 [details] video testing the bug I tried one more time. The text is in "Default Paragraph Style", and after Tools-Autocorrect-Apply it became "Text body" and "doi:10.1259/bjr.20190594" became "Doi:10.1259/bjr.20190594".
This is caused by auto capitalize. If you keep the first "D" as lower case, it should work.
Maybe you can try typing something random in the beginning of the line and add a space, and then type the doi. eg. abc doi:10.1259/bjr.20190594
Yes, it is working like that, with abc doi:10.1259/bjr.20190594 Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: a772976f047882918d5386a3ef9226c4aa2aa118 CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3 Locale: ro-RO (ro_RO.UTF-8); UI: en-US Calc: threaded But, for the future, you should also take this case of beginning a new line with a doi.
(In reply to BogdanB from comment #15) > Yes, it is working like that, with > abc doi:10.1259/bjr.20190594 > > Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community > Build ID: a772976f047882918d5386a3ef9226c4aa2aa118 > CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3 > Locale: ro-RO (ro_RO.UTF-8); UI: en-US > Calc: threaded > > But, for the future, you should also take this case of beginning a new line > with a doi. Yeah, I can definitely support this case, just like what url recognition does. In url recognition, if you type www.google.com, it will become a hyperlink with text Www.google.com. I wasn't sure whether this should be expected before. If it is agreed that we can recognize doi even if the first character is captilized, I can implement it quickly.
Baole Fang committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e8d7bf954fe74ce85bdd084d6e12d27027a4c379 tdf#145925: Support AutoCapitalize in DOI recognition It will be available in 7.6.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.
Working very well now. You can mark this bug as resolved, IF everything you planned is done. I tested in 2 ways: - Write doi:10.1259/bjr.20190594 Select text and click Tools, AutoCorrect, Apply: GOOD - Write doi:10.1259/bjr.20190594 and press Enter: GOOD Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: bb198176684c3d9377e26c04a29ec66deb811949 CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3 Locale: ro-RO (ro_RO.UTF-8); UI: en-US Calc: threaded
Thanks so much!!!!
Verified with Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: bb198176684c3d9377e26c04a29ec66deb811949 CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3 Locale: ro-RO (ro_RO.UTF-8); UI: en-US Calc: threaded
You are welcome. Let me know if there is any more question.
Baole, please don't change back from verified status. Verified is better than resolved. One bug is "resolved" when you decide that you have done what is needed. The same bug is "verified" when others test it and see that you indeed have done that job. I am the one that have verified that you have done a good job.
Got it.