Skip to content

Commit 8592b54

Browse files
authored
Support left/right single quotation marks in text and arguments (#3192)
1 parent 5234b52 commit 8592b54

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pygmt/helpers/utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,11 @@ def non_ascii_to_octal(argstr):
305305
c: "\\" + format(i, "o")
306306
for c, i in zip(
307307
"•…™—–fiž" # \03x. \030 is undefined
308+
"’‘" # \047 and \140
308309
"š" # \177
309310
"Œ†‡Ł⁄‹Š›œŸŽł‰„“”" # \20x-\21x
310311
"ı`´ˆ˜¯˘˙¨‚˚¸'˝˛ˇ", # \22x-\23x
311-
[*range(25, 32), *range(127, 160)],
312+
[*range(25, 32), 39, 96, *range(127, 160)],
312313
strict=True,
313314
)
314315
}

pygmt/tests/test_text.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,5 +430,5 @@ def test_text_quotation_marks():
430430
"""
431431
fig = Figure()
432432
fig.basemap(projection="X4c/2c", region=[0, 4, 0, 2], frame=0)
433-
fig.text(x=2, y=1, text="\\234 \\140 ' \" \\216 \\217", font="20p")
433+
fig.text(x=2, y=1, text='\\234 ‘ ’ " “ ”', font="20p") # noqa: RUF001
434434
return fig

0 commit comments

Comments
 (0)