• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Reference Documentation: PDF Publishing with GNU Troff


Commit MetaInfo

Revisionbc5886a88fba8a391e5fea131d04356c62b7a982 (tree)
Time2024-05-15 17:58:52
AuthorKeith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Validate link destination name assignments.

* tmac/pdfmark.tmac (pdfhref): In internal-use macros...
(pdf*href-D, pdf*href.set): ...accept only destination name arguments
which are valid as groff identifiers.

Change Summary

Incremental Difference

diff -r 96facd5c0532 -r bc5886a88fba tmac/pdfmark.tmac
--- a/tmac/pdfmark.tmac Thu Apr 25 19:44:42 2024 +0100
+++ b/tmac/pdfmark.tmac Wed May 15 09:58:52 2024 +0100
@@ -1288,35 +1288,44 @@
12881288 .\" ----------------------------------------------------------------------
12891289 .pdf*href.map.init
12901290 .ie \\n(.$ \{\
1291-. \"
1292-. \" a marker name has been supplied ...
1293-. \" if we are formatting for immediate output,
1294-. \" emit PDFMARK code to establish the associated view
1291+. \" a destination name has been supplied ...
12951292 . \"
1296-. ie '\\n(.z'' \{\
1297-. pdf:href.sety
1298-. pdfmark /Dest /\\$1 /View [\\*[PDFHREF.VIEW]] /DEST
1299-. ds PDFHREF.NAME \\$1
1300-. rr PDFPAGE.Y
1293+. ie \A'\\$1' \{\
1294+. \" ...and it is a valid identifier ...
1295+. \" if we are formatting for immediate output,
1296+. \" emit PDFMARK code to establish the associated view
1297+. \"
1298+. ie '\\n(.z'' \{\
1299+. pdf:href.sety
1300+. pdfmark /Dest /\\$1 /View [\\*[PDFHREF.VIEW]] /DEST
1301+. ds PDFHREF.NAME \\$1
1302+. rr PDFPAGE.Y
1303+. \}
1304+. \" but, when formatting a diversion ...
1305+. \" delay output of the PDFMARK code, until the diversion
1306+. \" is eventually written out
1307+. \"
1308+. el \!.\\$0 \\$@
1309+. \"
1310+. \" check if we also need to emit cross reference data
1311+. \" (caller will do this if "pdf:href-X" is set, but it is
1312+. \" not necessary, when "pdf:href.map" already exists)
1313+. \"
1314+. if dpdf:href.map .nr pdf:href-X 0
13011315 . \}
1302-. \"
1303-. \" but, when formatting a diversion ...
1304-. \" delay output of the PDFMARK code, until the diversion
1305-. \" is eventually written out
1306-. \"
1307-. el \!.\\$0 \\$@
1308-. \"
1309-. \" check if we also need to emit cross reference data
1310-. \" (caller will do this if "pdf:href-X" is set, but it is
1311-. \" not necessary, when "pdf:href.map" already exists)
1312-. \"
1313-. if dpdf:href.map .nr pdf:href-X 0
1316+. el \{\
1317+. \" given destination name is invalid ...
1318+. \" diagnose; do not emit reference data
1319+. \"
1320+. pdf:error destination name "\\$1" is invalid
1321+. nr pdf:href-X 0
1322+. \}
13141323 . \}
13151324 .el \{\
1316-. \" marker is unnamed ...
1325+. \" no destination name was supplied ...
13171326 . \" issue error message; do not emit reference data
13181327 . \"
1319-. pdf:warn pdfhref destination marker must be named
1328+. pdf:error pdfhref destination mark must be named
13201329 . nr pdf:href-X 0
13211330 . \}
13221331 ..
@@ -1363,7 +1372,8 @@
13631372 . pdf:warn pdfhref defined reference requires a name
13641373 . \}
13651374 .el \{\
1366-. ds pdf:href(\\*[pdf:href-N]).info \\$*
1375+. ie \A'\\*[pdf:href-N]' .ds pdf:href(\\*[pdf:href-N]).info \\$*
1376+. el .pdf:error destination name "\\*[pdf:href-N]" is invalid
13671377 . \}
13681378 ..
13691379 .\"