Enabling PDF tagging corrupts the URLs displayed in bibliographies.

MWE:

    \setuptagging[state=start]

    \usebtxdataset[mkiv-publications.bib]
    \usebtxdefinitions[apa]
    % \usebtxdefinitions[chicago]

    \starttext
    \nocite[article, advancedonline]
    \placelistofpublications
    \stoptext

I think that APA and Chicago are the only styles that display URLs in
the bibliography, but there may be others that I'm missing. There's a
patch at the end that seems to fix things for me, although there's
likely a better solution.

-- Max

--- texmf-context/tex/context/base/mkiv/publ-ini.old    2022-06-30 
14:54:35.422262400 -0600
+++ texmf-context/tex/context/base/mkiv/publ-ini.mkiv   2022-06-30 
15:06:28.975132000 -0600
@@ -399,6 +399,7 @@
 % This fails when we check field values:
\let\btxrawfield\btxfield
+\let\btxrawflush\btxflush
\def\btxfield #1{\dostarttagged\t!pubfld{#1}\clf_btxfield {\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}
 \def\btxdetail     
#1{\dostarttagged\t!pubfld{#1}\clf_btxdetail{\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}


--- texmf-context/tex/context/base/mkxl/publ-ini.old    2022-06-30 
15:05:36.018821900 -0600
+++ texmf-context/tex/context/base/mkxl/publ-ini.mkxl   2022-06-30 
15:06:22.220074900 -0600
@@ -399,6 +399,7 @@
 \aliased\let\btxsetup\fastsetup
\permanent\def\btxrawfield #1{\clf_btxfield {\currentbtxdataset}{\currentbtxtag}{#1}}
+\permanent\def\btxrawflush   #1{\clf_btxflush 
{\currentbtxdataset}{\currentbtxtag}{#1}}
\permanent\def\btxfield #1{\dostarttagged\t!pubfld{#1}\clf_btxfield {\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}
 \permanent\def\btxdetail     
#1{\dostarttagged\t!pubfld{#1}\clf_btxdetail{\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}


--- texmf-context/tex/context/base/mkiv/publ-imp-apa.old        2022-06-30 
14:56:18.210565000 -0600
+++ texmf-context/tex/context/base/mkiv/publ-imp-apa.mkvi       2022-06-30 
14:56:40.611212000 -0600
@@ -1263,12 +1263,12 @@
         \setbreakpoints[doi]
         \ifconditional\btxinteractive
             \goto {
-                \hyphenatedurl{\btxflush{url}}
+                \hyphenatedurl{\btxrawflush{url}}
             } [
-                url(\btxflush{url})
+                url(\btxrawflush{url})
             ]
         \else
-            \hyphenatedurl{\btxflush{url}}
+            \hyphenatedurl{\btxrawflush{url}}
         \fi
     \endgroup
 \stoptexdefinition
@@ -1280,12 +1280,12 @@
         \setbreakpoints[doi]
         \ifconditional\btxinteractive
             \goto {
-                \hyphenatedurl{doi:\btxflush{doi}}
+                \hyphenatedurl{doi:\btxrawflush{doi}}
             } [
-                url(http://dx.doi.org/\btxflush{doi})
+                url(http://dx.doi.org/\btxrawflush{doi})
             ]
         \else
-            \hyphenatedurl{doi:\btxflush{doi}}
+            \hyphenatedurl{doi:\btxrawflush{doi}}
         \fi
     \endgroup
 \stoptexdefinition


--- texmf-context/tex/context/base/mkiv/publ-imp-chicago.old    2022-06-30 
14:59:53.310100000 -0600
+++ texmf-context/tex/context/base/mkiv/publ-imp-chicago.mkvi   2022-06-30 
15:00:39.497438200 -0600
@@ -1258,12 +1258,12 @@
         \setbreakpoints[doi]
         \ifconditional\btxinteractive
             \goto {
-                \hyphenatedurl{\btxflush{url}}
+                \hyphenatedurl{\btxrawflush{url}}
             } [
-                url(\btxflush{url})
+                url(\btxrawflush{url})
             ]
         \else
-            \hyphenatedurl{\btxflush{url}}
+            \hyphenatedurl{\btxrawflush{url}}
         \fi
     \endgroup
 \stoptexdefinition
@@ -1275,12 +1275,12 @@
         \setbreakpoints[doi]
         \ifconditional\btxinteractive
             \goto {
-                \hyphenatedurl{doi:\btxflush{doi}}
+                \hyphenatedurl{doi:\btxrawflush{doi}}
             } [
-                url(http://dx.doi.org/\btxflush{doi})
+                url(http://dx.doi.org/\btxrawflush{doi})
             ]
         \else
-            \hyphenatedurl{doi:\btxflush{doi}}
+            \hyphenatedurl{doi:\btxrawflush{doi}}
         \fi
     \endgroup
 \stoptexdefinition
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to