pygments.rb 2.4.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (349) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +8 -8
  3. data/.github/workflows/release.yml +5 -5
  4. data/.gitignore +2 -0
  5. data/.rubocop.yml +1 -1
  6. data/CHANGELOG.adoc +12 -0
  7. data/README.adoc +2 -2
  8. data/lib/pygments/popen.rb +2 -2
  9. data/lib/pygments/version.rb +1 -1
  10. data/pygments.rb.gemspec +3 -3
  11. data/vendor/pygments-main/bin/pygmentize +1 -1
  12. data/vendor/pygments-main/pygments/__init__.py +2 -2
  13. data/vendor/pygments-main/pygments/__main__.py +1 -1
  14. data/vendor/pygments-main/pygments/cmdline.py +12 -12
  15. data/vendor/pygments-main/pygments/console.py +5 -5
  16. data/vendor/pygments-main/pygments/filter.py +2 -3
  17. data/vendor/pygments-main/pygments/filters/__init__.py +4 -4
  18. data/vendor/pygments-main/pygments/formatter.py +6 -1
  19. data/vendor/pygments-main/pygments/formatters/__init__.py +7 -8
  20. data/vendor/pygments-main/pygments/formatters/_mapping.py +0 -0
  21. data/vendor/pygments-main/pygments/formatters/bbcode.py +2 -2
  22. data/vendor/pygments-main/pygments/formatters/groff.py +3 -3
  23. data/vendor/pygments-main/pygments/formatters/html.py +38 -40
  24. data/vendor/pygments-main/pygments/formatters/img.py +51 -11
  25. data/vendor/pygments-main/pygments/formatters/irc.py +1 -1
  26. data/vendor/pygments-main/pygments/formatters/latex.py +24 -27
  27. data/vendor/pygments-main/pygments/formatters/other.py +3 -4
  28. data/vendor/pygments-main/pygments/formatters/pangomarkup.py +2 -2
  29. data/vendor/pygments-main/pygments/formatters/rtf.py +228 -25
  30. data/vendor/pygments-main/pygments/formatters/svg.py +17 -20
  31. data/vendor/pygments-main/pygments/formatters/terminal.py +1 -1
  32. data/vendor/pygments-main/pygments/formatters/terminal256.py +1 -1
  33. data/vendor/pygments-main/pygments/lexer.py +51 -33
  34. data/vendor/pygments-main/pygments/lexers/__init__.py +12 -12
  35. data/vendor/pygments-main/pygments/lexers/_ada_builtins.py +1 -1
  36. data/vendor/pygments-main/pygments/lexers/_asy_builtins.py +1 -1
  37. data/vendor/pygments-main/pygments/lexers/_cl_builtins.py +1 -1
  38. data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +2 -2
  39. data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1 -1
  40. data/vendor/pygments-main/pygments/lexers/_css_builtins.py +1 -1
  41. data/vendor/pygments-main/pygments/lexers/_julia_builtins.py +1 -1
  42. data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +1 -1
  43. data/vendor/pygments-main/pygments/lexers/_lilypond_builtins.py +1 -1
  44. data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +5 -5
  45. data/vendor/pygments-main/pygments/lexers/_luau_builtins.py +62 -0
  46. data/vendor/pygments-main/pygments/lexers/_mapping.py +41 -11
  47. data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1 -1
  48. data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +3 -3
  49. data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +1 -1
  50. data/vendor/pygments-main/pygments/lexers/_php_builtins.py +3 -3
  51. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +5 -5
  52. data/vendor/pygments-main/pygments/lexers/_qlik_builtins.py +1 -1
  53. data/vendor/pygments-main/pygments/lexers/_scheme_builtins.py +1 -1
  54. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +4 -4
  55. data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +3 -3
  56. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +1 -1
  57. data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +1 -1
  58. data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1 -1
  59. data/vendor/pygments-main/pygments/lexers/_usd_builtins.py +1 -1
  60. data/vendor/pygments-main/pygments/lexers/_vbscript_builtins.py +1 -1
  61. data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1 -1
  62. data/vendor/pygments-main/pygments/lexers/actionscript.py +6 -8
  63. data/vendor/pygments-main/pygments/lexers/ada.py +3 -3
  64. data/vendor/pygments-main/pygments/lexers/agile.py +3 -1
  65. data/vendor/pygments-main/pygments/lexers/algebra.py +9 -13
  66. data/vendor/pygments-main/pygments/lexers/ambient.py +2 -3
  67. data/vendor/pygments-main/pygments/lexers/amdgpu.py +3 -3
  68. data/vendor/pygments-main/pygments/lexers/ampl.py +2 -3
  69. data/vendor/pygments-main/pygments/lexers/apdlexer.py +4 -3
  70. data/vendor/pygments-main/pygments/lexers/apl.py +2 -3
  71. data/vendor/pygments-main/pygments/lexers/archetype.py +8 -12
  72. data/vendor/pygments-main/pygments/lexers/arrow.py +2 -3
  73. data/vendor/pygments-main/pygments/lexers/arturo.py +2 -3
  74. data/vendor/pygments-main/pygments/lexers/asc.py +4 -4
  75. data/vendor/pygments-main/pygments/lexers/asm.py +28 -15
  76. data/vendor/pygments-main/pygments/lexers/asn1.py +178 -0
  77. data/vendor/pygments-main/pygments/lexers/automation.py +6 -8
  78. data/vendor/pygments-main/pygments/lexers/bare.py +2 -3
  79. data/vendor/pygments-main/pygments/lexers/basic.py +48 -57
  80. data/vendor/pygments-main/pygments/lexers/bdd.py +3 -4
  81. data/vendor/pygments-main/pygments/lexers/berry.py +4 -4
  82. data/vendor/pygments-main/pygments/lexers/bibtex.py +5 -5
  83. data/vendor/pygments-main/pygments/lexers/blueprint.py +173 -0
  84. data/vendor/pygments-main/pygments/lexers/boa.py +4 -4
  85. data/vendor/pygments-main/pygments/lexers/bqn.py +109 -0
  86. data/vendor/pygments-main/pygments/lexers/business.py +21 -22
  87. data/vendor/pygments-main/pygments/lexers/c_cpp.py +9 -4
  88. data/vendor/pygments-main/pygments/lexers/c_like.py +99 -27
  89. data/vendor/pygments-main/pygments/lexers/capnproto.py +2 -3
  90. data/vendor/pygments-main/pygments/lexers/carbon.py +10 -11
  91. data/vendor/pygments-main/pygments/lexers/cddl.py +8 -9
  92. data/vendor/pygments-main/pygments/lexers/chapel.py +2 -3
  93. data/vendor/pygments-main/pygments/lexers/clean.py +2 -1
  94. data/vendor/pygments-main/pygments/lexers/comal.py +2 -1
  95. data/vendor/pygments-main/pygments/lexers/compiled.py +2 -1
  96. data/vendor/pygments-main/pygments/lexers/configs.py +342 -108
  97. data/vendor/pygments-main/pygments/lexers/console.py +5 -5
  98. data/vendor/pygments-main/pygments/lexers/cplint.py +2 -3
  99. data/vendor/pygments-main/pygments/lexers/crystal.py +4 -5
  100. data/vendor/pygments-main/pygments/lexers/csound.py +6 -8
  101. data/vendor/pygments-main/pygments/lexers/css.py +5 -5
  102. data/vendor/pygments-main/pygments/lexers/d.py +4 -3
  103. data/vendor/pygments-main/pygments/lexers/dalvik.py +2 -3
  104. data/vendor/pygments-main/pygments/lexers/data.py +8 -12
  105. data/vendor/pygments-main/pygments/lexers/dax.py +2 -3
  106. data/vendor/pygments-main/pygments/lexers/devicetree.py +2 -3
  107. data/vendor/pygments-main/pygments/lexers/diff.py +7 -6
  108. data/vendor/pygments-main/pygments/lexers/dns.py +109 -0
  109. data/vendor/pygments-main/pygments/lexers/dotnet.py +19 -14
  110. data/vendor/pygments-main/pygments/lexers/dsls.py +24 -35
  111. data/vendor/pygments-main/pygments/lexers/dylan.py +8 -16
  112. data/vendor/pygments-main/pygments/lexers/ecl.py +2 -3
  113. data/vendor/pygments-main/pygments/lexers/eiffel.py +3 -4
  114. data/vendor/pygments-main/pygments/lexers/elm.py +3 -4
  115. data/vendor/pygments-main/pygments/lexers/elpi.py +28 -21
  116. data/vendor/pygments-main/pygments/lexers/email.py +3 -3
  117. data/vendor/pygments-main/pygments/lexers/erlang.py +22 -24
  118. data/vendor/pygments-main/pygments/lexers/esoteric.py +11 -12
  119. data/vendor/pygments-main/pygments/lexers/ezhil.py +2 -3
  120. data/vendor/pygments-main/pygments/lexers/factor.py +2 -3
  121. data/vendor/pygments-main/pygments/lexers/fantom.py +3 -3
  122. data/vendor/pygments-main/pygments/lexers/felix.py +9 -10
  123. data/vendor/pygments-main/pygments/lexers/fift.py +2 -1
  124. data/vendor/pygments-main/pygments/lexers/floscript.py +2 -3
  125. data/vendor/pygments-main/pygments/lexers/forth.py +2 -3
  126. data/vendor/pygments-main/pygments/lexers/fortran.py +6 -7
  127. data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
  128. data/vendor/pygments-main/pygments/lexers/freefem.py +2 -3
  129. data/vendor/pygments-main/pygments/lexers/func.py +3 -1
  130. data/vendor/pygments-main/pygments/lexers/functional.py +2 -1
  131. data/vendor/pygments-main/pygments/lexers/futhark.py +6 -7
  132. data/vendor/pygments-main/pygments/lexers/gcodelexer.py +3 -3
  133. data/vendor/pygments-main/pygments/lexers/gdscript.py +2 -1
  134. data/vendor/pygments-main/pygments/lexers/go.py +3 -4
  135. data/vendor/pygments-main/pygments/lexers/grammar_notation.py +6 -9
  136. data/vendor/pygments-main/pygments/lexers/graph.py +12 -9
  137. data/vendor/pygments-main/pygments/lexers/graphics.py +13 -17
  138. data/vendor/pygments-main/pygments/lexers/graphql.py +176 -0
  139. data/vendor/pygments-main/pygments/lexers/graphviz.py +2 -3
  140. data/vendor/pygments-main/pygments/lexers/gsql.py +2 -3
  141. data/vendor/pygments-main/pygments/lexers/haskell.py +27 -32
  142. data/vendor/pygments-main/pygments/lexers/haxe.py +3 -5
  143. data/vendor/pygments-main/pygments/lexers/hdl.py +8 -7
  144. data/vendor/pygments-main/pygments/lexers/hexdump.py +3 -3
  145. data/vendor/pygments-main/pygments/lexers/html.py +34 -13
  146. data/vendor/pygments-main/pygments/lexers/idl.py +2 -3
  147. data/vendor/pygments-main/pygments/lexers/igor.py +305 -290
  148. data/vendor/pygments-main/pygments/lexers/inferno.py +2 -3
  149. data/vendor/pygments-main/pygments/lexers/installers.py +7 -9
  150. data/vendor/pygments-main/pygments/lexers/int_fiction.py +150 -162
  151. data/vendor/pygments-main/pygments/lexers/iolang.py +2 -3
  152. data/vendor/pygments-main/pygments/lexers/j.py +2 -3
  153. data/vendor/pygments-main/pygments/lexers/javascript.py +18 -19
  154. data/vendor/pygments-main/pygments/lexers/jmespath.py +2 -1
  155. data/vendor/pygments-main/pygments/lexers/jslt.py +2 -3
  156. data/vendor/pygments-main/pygments/lexers/jsonnet.py +4 -3
  157. data/vendor/pygments-main/pygments/lexers/jsx.py +75 -0
  158. data/vendor/pygments-main/pygments/lexers/julia.py +4 -5
  159. data/vendor/pygments-main/pygments/lexers/jvm.py +98 -116
  160. data/vendor/pygments-main/pygments/lexers/kuin.py +2 -3
  161. data/vendor/pygments-main/pygments/lexers/kusto.py +93 -0
  162. data/vendor/pygments-main/pygments/lexers/ldap.py +155 -0
  163. data/vendor/pygments-main/pygments/lexers/lean.py +241 -0
  164. data/vendor/pygments-main/pygments/lexers/lilypond.py +2 -3
  165. data/vendor/pygments-main/pygments/lexers/lisp.py +373 -65
  166. data/vendor/pygments-main/pygments/lexers/macaulay2.py +53 -4
  167. data/vendor/pygments-main/pygments/lexers/make.py +7 -5
  168. data/vendor/pygments-main/pygments/lexers/markup.py +242 -91
  169. data/vendor/pygments-main/pygments/lexers/math.py +2 -1
  170. data/vendor/pygments-main/pygments/lexers/matlab.py +10 -12
  171. data/vendor/pygments-main/pygments/lexers/maxima.py +2 -3
  172. data/vendor/pygments-main/pygments/lexers/meson.py +2 -3
  173. data/vendor/pygments-main/pygments/lexers/mime.py +4 -4
  174. data/vendor/pygments-main/pygments/lexers/minecraft.py +24 -27
  175. data/vendor/pygments-main/pygments/lexers/mips.py +3 -1
  176. data/vendor/pygments-main/pygments/lexers/ml.py +59 -61
  177. data/vendor/pygments-main/pygments/lexers/modeling.py +19 -22
  178. data/vendor/pygments-main/pygments/lexers/modula2.py +2 -3
  179. data/vendor/pygments-main/pygments/lexers/mojo.py +704 -0
  180. data/vendor/pygments-main/pygments/lexers/monte.py +2 -3
  181. data/vendor/pygments-main/pygments/lexers/mosel.py +3 -3
  182. data/vendor/pygments-main/pygments/lexers/ncl.py +4 -3
  183. data/vendor/pygments-main/pygments/lexers/nimrod.py +7 -8
  184. data/vendor/pygments-main/pygments/lexers/nit.py +2 -3
  185. data/vendor/pygments-main/pygments/lexers/nix.py +40 -31
  186. data/vendor/pygments-main/pygments/lexers/oberon.py +3 -3
  187. data/vendor/pygments-main/pygments/lexers/objective.py +14 -6
  188. data/vendor/pygments-main/pygments/lexers/ooc.py +2 -3
  189. data/vendor/pygments-main/pygments/lexers/openscad.py +96 -0
  190. data/vendor/pygments-main/pygments/lexers/other.py +2 -1
  191. data/vendor/pygments-main/pygments/lexers/parasail.py +2 -3
  192. data/vendor/pygments-main/pygments/lexers/parsers.py +41 -44
  193. data/vendor/pygments-main/pygments/lexers/pascal.py +6 -3
  194. data/vendor/pygments-main/pygments/lexers/pawn.py +5 -5
  195. data/vendor/pygments-main/pygments/lexers/perl.py +3 -3
  196. data/vendor/pygments-main/pygments/lexers/phix.py +2 -3
  197. data/vendor/pygments-main/pygments/lexers/php.py +4 -5
  198. data/vendor/pygments-main/pygments/lexers/pointless.py +2 -3
  199. data/vendor/pygments-main/pygments/lexers/pony.py +3 -3
  200. data/vendor/pygments-main/pygments/lexers/praat.py +2 -3
  201. data/vendor/pygments-main/pygments/lexers/procfile.py +2 -3
  202. data/vendor/pygments-main/pygments/lexers/prolog.py +23 -9
  203. data/vendor/pygments-main/pygments/lexers/promql.py +2 -1
  204. data/vendor/pygments-main/pygments/lexers/prql.py +251 -0
  205. data/vendor/pygments-main/pygments/lexers/ptx.py +119 -0
  206. data/vendor/pygments-main/pygments/lexers/python.py +24 -24
  207. data/vendor/pygments-main/pygments/lexers/q.py +5 -6
  208. data/vendor/pygments-main/pygments/lexers/qlik.py +3 -3
  209. data/vendor/pygments-main/pygments/lexers/qvt.py +5 -3
  210. data/vendor/pygments-main/pygments/lexers/r.py +8 -6
  211. data/vendor/pygments-main/pygments/lexers/rdf.py +19 -13
  212. data/vendor/pygments-main/pygments/lexers/rebol.py +7 -7
  213. data/vendor/pygments-main/pygments/lexers/resource.py +5 -6
  214. data/vendor/pygments-main/pygments/lexers/ride.py +4 -5
  215. data/vendor/pygments-main/pygments/lexers/rita.py +2 -3
  216. data/vendor/pygments-main/pygments/lexers/rnc.py +2 -3
  217. data/vendor/pygments-main/pygments/lexers/roboconf.py +5 -5
  218. data/vendor/pygments-main/pygments/lexers/robotframework.py +2 -3
  219. data/vendor/pygments-main/pygments/lexers/ruby.py +8 -13
  220. data/vendor/pygments-main/pygments/lexers/rust.py +9 -10
  221. data/vendor/pygments-main/pygments/lexers/sas.py +3 -3
  222. data/vendor/pygments-main/pygments/lexers/savi.py +131 -130
  223. data/vendor/pygments-main/pygments/lexers/scdoc.py +13 -7
  224. data/vendor/pygments-main/pygments/lexers/scripting.py +354 -42
  225. data/vendor/pygments-main/pygments/lexers/sgf.py +2 -3
  226. data/vendor/pygments-main/pygments/lexers/shell.py +107 -129
  227. data/vendor/pygments-main/pygments/lexers/sieve.py +3 -3
  228. data/vendor/pygments-main/pygments/lexers/slash.py +4 -5
  229. data/vendor/pygments-main/pygments/lexers/smalltalk.py +3 -5
  230. data/vendor/pygments-main/pygments/lexers/smithy.py +2 -3
  231. data/vendor/pygments-main/pygments/lexers/smv.py +3 -3
  232. data/vendor/pygments-main/pygments/lexers/snobol.py +3 -3
  233. data/vendor/pygments-main/pygments/lexers/solidity.py +3 -3
  234. data/vendor/pygments-main/pygments/lexers/soong.py +78 -0
  235. data/vendor/pygments-main/pygments/lexers/sophia.py +3 -4
  236. data/vendor/pygments-main/pygments/lexers/special.py +8 -3
  237. data/vendor/pygments-main/pygments/lexers/spice.py +15 -16
  238. data/vendor/pygments-main/pygments/lexers/sql.py +24 -18
  239. data/vendor/pygments-main/pygments/lexers/srcinfo.py +3 -3
  240. data/vendor/pygments-main/pygments/lexers/stata.py +2 -3
  241. data/vendor/pygments-main/pygments/lexers/supercollider.py +2 -3
  242. data/vendor/pygments-main/pygments/lexers/tact.py +303 -0
  243. data/vendor/pygments-main/pygments/lexers/tal.py +13 -10
  244. data/vendor/pygments-main/pygments/lexers/tcl.py +2 -3
  245. data/vendor/pygments-main/pygments/lexers/teal.py +2 -3
  246. data/vendor/pygments-main/pygments/lexers/templates.py +131 -72
  247. data/vendor/pygments-main/pygments/lexers/teraterm.py +2 -3
  248. data/vendor/pygments-main/pygments/lexers/testing.py +4 -5
  249. data/vendor/pygments-main/pygments/lexers/text.py +2 -1
  250. data/vendor/pygments-main/pygments/lexers/textedit.py +9 -6
  251. data/vendor/pygments-main/pygments/lexers/textfmts.py +20 -15
  252. data/vendor/pygments-main/pygments/lexers/theorem.py +41 -115
  253. data/vendor/pygments-main/pygments/lexers/thingsdb.py +50 -26
  254. data/vendor/pygments-main/pygments/lexers/tlb.py +3 -1
  255. data/vendor/pygments-main/pygments/lexers/tls.py +54 -0
  256. data/vendor/pygments-main/pygments/lexers/tnt.py +2 -3
  257. data/vendor/pygments-main/pygments/lexers/trafficscript.py +3 -3
  258. data/vendor/pygments-main/pygments/lexers/typoscript.py +6 -7
  259. data/vendor/pygments-main/pygments/lexers/typst.py +104 -0
  260. data/vendor/pygments-main/pygments/lexers/ul4.py +47 -5
  261. data/vendor/pygments-main/pygments/lexers/unicon.py +9 -7
  262. data/vendor/pygments-main/pygments/lexers/urbi.py +3 -3
  263. data/vendor/pygments-main/pygments/lexers/usd.py +6 -11
  264. data/vendor/pygments-main/pygments/lexers/varnish.py +5 -5
  265. data/vendor/pygments-main/pygments/lexers/verification.py +4 -5
  266. data/vendor/pygments-main/pygments/lexers/verifpal.py +65 -0
  267. data/vendor/pygments-main/pygments/lexers/vip.py +150 -0
  268. data/vendor/pygments-main/pygments/lexers/vyper.py +140 -0
  269. data/vendor/pygments-main/pygments/lexers/web.py +2 -1
  270. data/vendor/pygments-main/pygments/lexers/webassembly.py +2 -3
  271. data/vendor/pygments-main/pygments/lexers/webidl.py +2 -3
  272. data/vendor/pygments-main/pygments/lexers/webmisc.py +11 -15
  273. data/vendor/pygments-main/pygments/lexers/wgsl.py +6 -7
  274. data/vendor/pygments-main/pygments/lexers/whiley.py +2 -3
  275. data/vendor/pygments-main/pygments/lexers/wowtoc.py +3 -3
  276. data/vendor/pygments-main/pygments/lexers/wren.py +3 -4
  277. data/vendor/pygments-main/pygments/lexers/x10.py +6 -7
  278. data/vendor/pygments-main/pygments/lexers/xorg.py +2 -1
  279. data/vendor/pygments-main/pygments/lexers/yang.py +2 -3
  280. data/vendor/pygments-main/pygments/lexers/yara.py +69 -0
  281. data/vendor/pygments-main/pygments/lexers/zig.py +2 -1
  282. data/vendor/pygments-main/pygments/modeline.py +4 -4
  283. data/vendor/pygments-main/pygments/plugin.py +3 -19
  284. data/vendor/pygments-main/pygments/regexopt.py +1 -1
  285. data/vendor/pygments-main/pygments/scanner.py +1 -1
  286. data/vendor/pygments-main/pygments/sphinxext.py +38 -8
  287. data/vendor/pygments-main/pygments/style.py +8 -2
  288. data/vendor/pygments-main/pygments/styles/__init__.py +17 -59
  289. data/vendor/pygments-main/pygments/styles/_mapping.py +54 -0
  290. data/vendor/pygments-main/pygments/styles/abap.py +5 -1
  291. data/vendor/pygments-main/pygments/styles/algol.py +5 -1
  292. data/vendor/pygments-main/pygments/styles/algol_nu.py +5 -1
  293. data/vendor/pygments-main/pygments/styles/arduino.py +76 -72
  294. data/vendor/pygments-main/pygments/styles/autumn.py +6 -1
  295. data/vendor/pygments-main/pygments/styles/borland.py +6 -1
  296. data/vendor/pygments-main/pygments/styles/bw.py +6 -1
  297. data/vendor/pygments-main/pygments/styles/coffee.py +80 -0
  298. data/vendor/pygments-main/pygments/styles/colorful.py +6 -1
  299. data/vendor/pygments-main/pygments/styles/default.py +6 -1
  300. data/vendor/pygments-main/pygments/styles/dracula.py +68 -80
  301. data/vendor/pygments-main/pygments/styles/emacs.py +6 -1
  302. data/vendor/pygments-main/pygments/styles/friendly.py +6 -1
  303. data/vendor/pygments-main/pygments/styles/friendly_grayscale.py +6 -1
  304. data/vendor/pygments-main/pygments/styles/fruity.py +7 -1
  305. data/vendor/pygments-main/pygments/styles/gh_dark.py +7 -1
  306. data/vendor/pygments-main/pygments/styles/gruvbox.py +10 -1
  307. data/vendor/pygments-main/pygments/styles/igor.py +6 -1
  308. data/vendor/pygments-main/pygments/styles/inkpot.py +7 -2
  309. data/vendor/pygments-main/pygments/styles/lightbulb.py +110 -0
  310. data/vendor/pygments-main/pygments/styles/lilypond.py +8 -2
  311. data/vendor/pygments-main/pygments/styles/lovelace.py +16 -10
  312. data/vendor/pygments-main/pygments/styles/manni.py +7 -2
  313. data/vendor/pygments-main/pygments/styles/material.py +21 -14
  314. data/vendor/pygments-main/pygments/styles/monokai.py +16 -10
  315. data/vendor/pygments-main/pygments/styles/murphy.py +7 -2
  316. data/vendor/pygments-main/pygments/styles/native.py +10 -5
  317. data/vendor/pygments-main/pygments/styles/nord.py +9 -3
  318. data/vendor/pygments-main/pygments/styles/onedark.py +6 -2
  319. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +7 -2
  320. data/vendor/pygments-main/pygments/styles/paraiso_light.py +7 -2
  321. data/vendor/pygments-main/pygments/styles/pastie.py +7 -1
  322. data/vendor/pygments-main/pygments/styles/perldoc.py +7 -1
  323. data/vendor/pygments-main/pygments/styles/rainbow_dash.py +26 -19
  324. data/vendor/pygments-main/pygments/styles/rrt.py +8 -2
  325. data/vendor/pygments-main/pygments/styles/sas.py +6 -1
  326. data/vendor/pygments-main/pygments/styles/solarized.py +9 -1
  327. data/vendor/pygments-main/pygments/styles/staroffice.py +6 -1
  328. data/vendor/pygments-main/pygments/styles/stata_dark.py +6 -2
  329. data/vendor/pygments-main/pygments/styles/stata_light.py +6 -1
  330. data/vendor/pygments-main/pygments/styles/tango.py +7 -3
  331. data/vendor/pygments-main/pygments/styles/trac.py +7 -1
  332. data/vendor/pygments-main/pygments/styles/vim.py +7 -1
  333. data/vendor/pygments-main/pygments/styles/vs.py +7 -2
  334. data/vendor/pygments-main/pygments/styles/xcode.py +6 -1
  335. data/vendor/pygments-main/pygments/styles/zenburn.py +6 -1
  336. data/vendor/pygments-main/pygments/token.py +2 -1
  337. data/vendor/pygments-main/pygments/unistring.py +5 -5
  338. data/vendor/pygments-main/pygments/util.py +13 -19
  339. data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/METADATA +14 -13
  340. data/vendor/pygments-main/pygments-2.18.0.dist-info/RECORD +663 -0
  341. data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/WHEEL +1 -2
  342. data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info/licenses}/AUTHORS +13 -0
  343. metadata +41 -17
  344. data/vendor/pygments-main/Pygments-2.15.1.dist-info/RECORD +0 -614
  345. data/vendor/pygments-main/Pygments-2.15.1.dist-info/top_level.txt +0 -1
  346. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/INSTALLER +0 -0
  347. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/REQUESTED +0 -0
  348. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info}/entry_points.txt +0 -0
  349. /data/vendor/pygments-main/{Pygments-2.15.1.dist-info → pygments-2.18.0.dist-info/licenses}/LICENSE +0 -0
@@ -4,7 +4,7 @@
4
4
 
5
5
  Formatter for HTML output.
6
6
 
7
- :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
@@ -62,7 +62,7 @@ def _get_ttype_class(ttype):
62
62
  CSSFILE_TEMPLATE = '''\
63
63
  /*
64
64
  generated by Pygments <https://pygments.org/>
65
- Copyright 2006-2023 by the Pygments team.
65
+ Copyright 2006-2024 by the Pygments team.
66
66
  Licensed under the BSD license, see LICENSE for details.
67
67
  */
68
68
  %(styledefs)s
@@ -73,7 +73,7 @@ DOC_HEADER = '''\
73
73
  "http://www.w3.org/TR/html4/strict.dtd">
74
74
  <!--
75
75
  generated by Pygments <https://pygments.org/>
76
- Copyright 2006-2023 by the Pygments team.
76
+ Copyright 2006-2024 by the Pygments team.
77
77
  Licensed under the BSD license, see LICENSE for details.
78
78
  -->
79
79
  <html>
@@ -323,6 +323,7 @@ class HtmlFormatter(Formatter):
323
323
  If set to the path of a ctags file, wrap names in anchor tags that
324
324
  link to their definitions. `lineanchors` should be used, and the
325
325
  tags file should specify line numbers (see the `-n` option to ctags).
326
+ The tags file is assumed to be encoded in UTF-8.
326
327
 
327
328
  .. versionadded:: 1.6
328
329
 
@@ -487,7 +488,7 @@ class HtmlFormatter(Formatter):
487
488
  name = self._get_css_class(ttype)
488
489
  style = ''
489
490
  if ndef['color']:
490
- style += 'color: %s; ' % webify(ndef['color'])
491
+ style += 'color: {}; '.format(webify(ndef['color']))
491
492
  if ndef['bold']:
492
493
  style += 'font-weight: bold; '
493
494
  if ndef['italic']:
@@ -495,9 +496,9 @@ class HtmlFormatter(Formatter):
495
496
  if ndef['underline']:
496
497
  style += 'text-decoration: underline; '
497
498
  if ndef['bgcolor']:
498
- style += 'background-color: %s; ' % webify(ndef['bgcolor'])
499
+ style += 'background-color: {}; '.format(webify(ndef['bgcolor']))
499
500
  if ndef['border']:
500
- style += 'border: 1px solid %s; ' % webify(ndef['border'])
501
+ style += 'border: 1px solid {}; '.format(webify(ndef['border']))
501
502
  if style:
502
503
  t2c[ttype] = name
503
504
  # save len(ttype) to enable ordering the styles by
@@ -529,7 +530,7 @@ class HtmlFormatter(Formatter):
529
530
  styles.sort()
530
531
 
531
532
  lines = [
532
- '%s { %s } /* %s */' % (prefix(cls), style, repr(ttype)[6:])
533
+ f'{prefix(cls)} {{ {style} }} /* {repr(ttype)[6:]} */'
533
534
  for (level, ttype, cls, style) in styles
534
535
  ]
535
536
 
@@ -547,24 +548,24 @@ class HtmlFormatter(Formatter):
547
548
  if Text in self.ttype2class:
548
549
  text_style = ' ' + self.class2style[self.ttype2class[Text]][0]
549
550
  lines.insert(
550
- 0, '%s{ background: %s;%s }' % (
551
+ 0, '{}{{ background: {};{} }}'.format(
551
552
  prefix(''), bg_color, text_style
552
553
  )
553
554
  )
554
555
  if hl_color is not None:
555
556
  lines.insert(
556
- 0, '%s { background-color: %s }' % (prefix('hll'), hl_color)
557
+ 0, '{} {{ background-color: {} }}'.format(prefix('hll'), hl_color)
557
558
  )
558
559
 
559
560
  return lines
560
561
 
561
562
  def get_linenos_style_defs(self):
562
563
  lines = [
563
- 'pre { %s }' % self._pre_style,
564
- 'td.linenos .normal { %s }' % self._linenos_style,
565
- 'span.linenos { %s }' % self._linenos_style,
566
- 'td.linenos .special { %s }' % self._linenos_special_style,
567
- 'span.linenos.special { %s }' % self._linenos_special_style,
564
+ f'pre {{ {self._pre_style} }}',
565
+ f'td.linenos .normal {{ {self._linenos_style} }}',
566
+ f'span.linenos {{ {self._linenos_style} }}',
567
+ f'td.linenos .special {{ {self._linenos_special_style} }}',
568
+ f'span.linenos.special {{ {self._linenos_special_style} }}',
568
569
  ]
569
570
 
570
571
  return lines
@@ -593,17 +594,15 @@ class HtmlFormatter(Formatter):
593
594
 
594
595
  @property
595
596
  def _linenos_style(self):
596
- return 'color: %s; background-color: %s; padding-left: 5px; padding-right: 5px;' % (
597
- self.style.line_number_color,
598
- self.style.line_number_background_color
599
- )
597
+ color = self.style.line_number_color
598
+ background_color = self.style.line_number_background_color
599
+ return f'color: {color}; background-color: {background_color}; padding-left: 5px; padding-right: 5px;'
600
600
 
601
601
  @property
602
602
  def _linenos_special_style(self):
603
- return 'color: %s; background-color: %s; padding-left: 5px; padding-right: 5px;' % (
604
- self.style.line_number_special_color,
605
- self.style.line_number_special_background_color
606
- )
603
+ color = self.style.line_number_special_color
604
+ background_color = self.style.line_number_special_background_color
605
+ return f'color: {color}; background-color: {background_color}; padding-left: 5px; padding-right: 5px;'
607
606
 
608
607
  def _decodeifneeded(self, value):
609
608
  if isinstance(value, bytes):
@@ -684,9 +683,9 @@ class HtmlFormatter(Formatter):
684
683
 
685
684
  if nocls:
686
685
  if special_line:
687
- style = ' style="%s"' % self._linenos_special_style
686
+ style = f' style="{self._linenos_special_style}"'
688
687
  else:
689
- style = ' style="%s"' % self._linenos_style
688
+ style = f' style="{self._linenos_style}"'
690
689
  else:
691
690
  if special_line:
692
691
  style = ' class="special"'
@@ -694,7 +693,7 @@ class HtmlFormatter(Formatter):
694
693
  style = ' class="normal"'
695
694
 
696
695
  if style:
697
- line = '<span%s>%s</span>' % (style, line)
696
+ line = f'<span{style}>{line}</span>'
698
697
 
699
698
  lines.append(line)
700
699
 
@@ -743,9 +742,9 @@ class HtmlFormatter(Formatter):
743
742
 
744
743
  if nocls:
745
744
  if special_line:
746
- style = ' style="%s"' % self._linenos_special_style
745
+ style = f' style="{self._linenos_special_style}"'
747
746
  else:
748
- style = ' style="%s"' % self._linenos_style
747
+ style = f' style="{self._linenos_style}"'
749
748
  else:
750
749
  if special_line:
751
750
  style = ' class="linenos special"'
@@ -753,7 +752,7 @@ class HtmlFormatter(Formatter):
753
752
  style = ' class="linenos"'
754
753
 
755
754
  if style:
756
- linenos = '<span%s>%s</span>' % (style, line)
755
+ linenos = f'<span{style}>{line}</span>'
757
756
  else:
758
757
  linenos = line
759
758
 
@@ -790,13 +789,13 @@ class HtmlFormatter(Formatter):
790
789
  style = []
791
790
  if (self.noclasses and not self.nobackground and
792
791
  self.style.background_color is not None):
793
- style.append('background: %s' % (self.style.background_color,))
792
+ style.append(f'background: {self.style.background_color}')
794
793
  if self.cssstyles:
795
794
  style.append(self.cssstyles)
796
795
  style = '; '.join(style)
797
796
 
798
- yield 0, ('<div' + (self.cssclass and ' class="%s"' % self.cssclass) +
799
- (style and (' style="%s"' % style)) + '>')
797
+ yield 0, ('<div' + (self.cssclass and f' class="{self.cssclass}"') +
798
+ (style and (f' style="{style}"')) + '>')
800
799
  yield from inner
801
800
  yield 0, '</div>\n'
802
801
 
@@ -813,7 +812,7 @@ class HtmlFormatter(Formatter):
813
812
 
814
813
  # the empty span here is to keep leading empty lines from being
815
814
  # ignored by HTML parsers
816
- yield 0, ('<pre' + (style and ' style="%s"' % style) + '><span></span>')
815
+ yield 0, ('<pre' + (style and f' style="{style}"') + '><span></span>')
817
816
  yield from inner
818
817
  yield 0, '</pre>'
819
818
 
@@ -842,18 +841,18 @@ class HtmlFormatter(Formatter):
842
841
  try:
843
842
  cspan = self.span_element_openers[ttype]
844
843
  except KeyError:
845
- title = ' title="%s"' % '.'.join(ttype) if self.debug_token_types else ''
844
+ title = ' title="{}"'.format('.'.join(ttype)) if self.debug_token_types else ''
846
845
  if nocls:
847
846
  css_style = self._get_css_inline_styles(ttype)
848
847
  if css_style:
849
848
  css_style = self.class2style[css_style][0]
850
- cspan = '<span style="%s"%s>' % (css_style, title)
849
+ cspan = f'<span style="{css_style}"{title}>'
851
850
  else:
852
851
  cspan = ''
853
852
  else:
854
853
  css_class = self._get_css_classes(ttype)
855
854
  if css_class:
856
- cspan = '<span class="%s"%s>' % (css_class, title)
855
+ cspan = f'<span class="{css_class}"{title}>'
857
856
  else:
858
857
  cspan = ''
859
858
  self.span_element_openers[ttype] = cspan
@@ -908,7 +907,7 @@ class HtmlFormatter(Formatter):
908
907
  def _lookup_ctag(self, token):
909
908
  entry = ctags.TagEntry()
910
909
  if self._ctags.find(entry, token.encode(), 0):
911
- return entry['file'], entry['lineNumber']
910
+ return entry['file'].decode(), entry['lineNumber']
912
911
  else:
913
912
  return None, None
914
913
 
@@ -926,11 +925,10 @@ class HtmlFormatter(Formatter):
926
925
  if self.noclasses:
927
926
  style = ''
928
927
  if self.style.highlight_color is not None:
929
- style = (' style="background-color: %s"' %
930
- (self.style.highlight_color,))
931
- yield 1, '<span%s>%s</span>' % (style, value)
928
+ style = (f' style="background-color: {self.style.highlight_color}"')
929
+ yield 1, f'<span{style}>{value}</span>'
932
930
  else:
933
- yield 1, '<span class="hll">%s</span>' % value
931
+ yield 1, f'<span class="hll">{value}</span>'
934
932
  else:
935
933
  yield 1, value
936
934
 
@@ -4,10 +4,9 @@
4
4
 
5
5
  Formatter for Pixmap output.
6
6
 
7
- :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
-
11
10
  import os
12
11
  import sys
13
12
 
@@ -68,6 +67,15 @@ class FontManager:
68
67
  self.font_size = font_size
69
68
  self.fonts = {}
70
69
  self.encoding = None
70
+ self.variable = False
71
+ if hasattr(font_name, 'read') or os.path.isfile(font_name):
72
+ font = ImageFont.truetype(font_name, self.font_size)
73
+ self.variable = True
74
+ for style in STYLES:
75
+ self.fonts[style] = font
76
+
77
+ return
78
+
71
79
  if sys.platform.startswith('win'):
72
80
  if not font_name:
73
81
  self.font_name = DEFAULT_FONT_NAME_WIN
@@ -82,7 +90,7 @@ class FontManager:
82
90
  self._create_nix()
83
91
 
84
92
  def _get_nix_font_path(self, name, style):
85
- proc = subprocess.Popen(['fc-list', "%s:style=%s" % (name, style), 'file'],
93
+ proc = subprocess.Popen(['fc-list', f"{name}:style={style}", 'file'],
86
94
  stdout=subprocess.PIPE, stderr=None)
87
95
  stdout, _ = proc.communicate()
88
96
  if proc.returncode == 0:
@@ -102,8 +110,7 @@ class FontManager:
102
110
  self.fonts['NORMAL'] = ImageFont.truetype(path, self.font_size)
103
111
  break
104
112
  else:
105
- raise FontNotFound('No usable fonts named: "%s"' %
106
- self.font_name)
113
+ raise FontNotFound(f'No usable fonts named: "{self.font_name}"')
107
114
  for style in ('ITALIC', 'BOLD', 'BOLDITALIC'):
108
115
  for stylename in STYLES[style]:
109
116
  path = self._get_nix_font_path(self.font_name, stylename)
@@ -134,8 +141,7 @@ class FontManager:
134
141
  self.fonts['NORMAL'] = ImageFont.truetype(path, self.font_size)
135
142
  break
136
143
  else:
137
- raise FontNotFound('No usable fonts named: "%s"' %
138
- self.font_name)
144
+ raise FontNotFound(f'No usable fonts named: "{self.font_name}"')
139
145
  for style in ('ITALIC', 'BOLD', 'BOLDITALIC'):
140
146
  for stylename in STYLES[style]:
141
147
  path = self._get_mac_font_path(font_map, self.font_name, stylename)
@@ -152,15 +158,14 @@ class FontManager:
152
158
  for suffix in ('', ' (TrueType)'):
153
159
  for style in styles:
154
160
  try:
155
- valname = '%s%s%s' % (basename, style and ' '+style, suffix)
161
+ valname = '{}{}{}'.format(basename, style and ' '+style, suffix)
156
162
  val, _ = _winreg.QueryValueEx(key, valname)
157
163
  return val
158
164
  except OSError:
159
165
  continue
160
166
  else:
161
167
  if fail:
162
- raise FontNotFound('Font %s (%s) not found in registry' %
163
- (basename, styles[0]))
168
+ raise FontNotFound(f'Font {basename} ({styles[0]}) not found in registry')
164
169
  return None
165
170
 
166
171
  def _create_win(self):
@@ -223,14 +228,43 @@ class FontManager:
223
228
  Get the font based on bold and italic flags.
224
229
  """
225
230
  if bold and oblique:
231
+ if self.variable:
232
+ return self.get_style('BOLDITALIC')
233
+
226
234
  return self.fonts['BOLDITALIC']
227
235
  elif bold:
236
+ if self.variable:
237
+ return self.get_style('BOLD')
238
+
228
239
  return self.fonts['BOLD']
229
240
  elif oblique:
241
+ if self.variable:
242
+ return self.get_style('ITALIC')
243
+
230
244
  return self.fonts['ITALIC']
231
245
  else:
246
+ if self.variable:
247
+ return self.get_style('NORMAL')
248
+
232
249
  return self.fonts['NORMAL']
233
250
 
251
+ def get_style(self, style):
252
+ """
253
+ Get the specified style of the font if it is a variable font.
254
+ If not found, return the normal font.
255
+ """
256
+ font = self.fonts[style]
257
+ for style_name in STYLES[style]:
258
+ try:
259
+ font.set_variation_by_name(style_name)
260
+ return font
261
+ except ValueError:
262
+ pass
263
+ except OSError:
264
+ return font
265
+
266
+ return font
267
+
234
268
 
235
269
  class ImageFormatter(Formatter):
236
270
  """
@@ -258,6 +292,8 @@ class ImageFormatter(Formatter):
258
292
  The font name to be used as the base font from which others, such as
259
293
  bold and italic fonts will be generated. This really should be a
260
294
  monospace font to look sane.
295
+ If a filename or a file-like object is specified, the user must
296
+ provide different styles of the font.
261
297
 
262
298
  Default: "Courier New" on Windows, "Menlo" on Mac OS, and
263
299
  "DejaVu Sans Mono" on \\*nix
@@ -594,7 +630,11 @@ class ImageFormatter(Formatter):
594
630
  fill=self.hl_color)
595
631
  for pos, value, font, text_fg, text_bg in self.drawables:
596
632
  if text_bg:
597
- text_size = draw.textsize(text=value, font=font)
633
+ # see deprecations https://pillow.readthedocs.io/en/stable/releasenotes/9.2.0.html#font-size-and-offset-methods
634
+ if hasattr(draw, 'textsize'):
635
+ text_size = draw.textsize(text=value, font=font)
636
+ else:
637
+ text_size = font.getbbox(value)[2:]
598
638
  draw.rectangle([pos[0], pos[1], pos[0] + text_size[0], pos[1] + text_size[1]], fill=text_bg)
599
639
  draw.text(pos, value, font=font, fill=text_fg)
600
640
  im.save(outfile, self.image_format.upper())
@@ -4,7 +4,7 @@
4
4
 
5
5
  Formatter for IRC output
6
6
 
7
- :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Formatter for LaTeX fancyvrb output.
6
6
 
7
- :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
@@ -23,21 +23,21 @@ def escape_tex(text, commandprefix):
23
23
  return text.replace('\\', '\x00'). \
24
24
  replace('{', '\x01'). \
25
25
  replace('}', '\x02'). \
26
- replace('\x00', r'\%sZbs{}' % commandprefix). \
27
- replace('\x01', r'\%sZob{}' % commandprefix). \
28
- replace('\x02', r'\%sZcb{}' % commandprefix). \
29
- replace('^', r'\%sZca{}' % commandprefix). \
30
- replace('_', r'\%sZus{}' % commandprefix). \
31
- replace('&', r'\%sZam{}' % commandprefix). \
32
- replace('<', r'\%sZlt{}' % commandprefix). \
33
- replace('>', r'\%sZgt{}' % commandprefix). \
34
- replace('#', r'\%sZsh{}' % commandprefix). \
35
- replace('%', r'\%sZpc{}' % commandprefix). \
36
- replace('$', r'\%sZdl{}' % commandprefix). \
37
- replace('-', r'\%sZhy{}' % commandprefix). \
38
- replace("'", r'\%sZsq{}' % commandprefix). \
39
- replace('"', r'\%sZdq{}' % commandprefix). \
40
- replace('~', r'\%sZti{}' % commandprefix)
26
+ replace('\x00', rf'\{commandprefix}Zbs{{}}'). \
27
+ replace('\x01', rf'\{commandprefix}Zob{{}}'). \
28
+ replace('\x02', rf'\{commandprefix}Zcb{{}}'). \
29
+ replace('^', rf'\{commandprefix}Zca{{}}'). \
30
+ replace('_', rf'\{commandprefix}Zus{{}}'). \
31
+ replace('&', rf'\{commandprefix}Zam{{}}'). \
32
+ replace('<', rf'\{commandprefix}Zlt{{}}'). \
33
+ replace('>', rf'\{commandprefix}Zgt{{}}'). \
34
+ replace('#', rf'\{commandprefix}Zsh{{}}'). \
35
+ replace('%', rf'\{commandprefix}Zpc{{}}'). \
36
+ replace('$', rf'\{commandprefix}Zdl{{}}'). \
37
+ replace('-', rf'\{commandprefix}Zhy{{}}'). \
38
+ replace("'", rf'\{commandprefix}Zsq{{}}'). \
39
+ replace('"', rf'\{commandprefix}Zdq{{}}'). \
40
+ replace('~', rf'\{commandprefix}Zti{{}}')
41
41
 
42
42
 
43
43
  DOC_TEMPLATE = r'''
@@ -304,17 +304,14 @@ class LatexFormatter(Formatter):
304
304
  if ndef['mono']:
305
305
  cmndef += r'\let\$$@ff=\textsf'
306
306
  if ndef['color']:
307
- cmndef += (r'\def\$$@tc##1{\textcolor[rgb]{%s}{##1}}' %
308
- rgbcolor(ndef['color']))
307
+ cmndef += (r'\def\$$@tc##1{{\textcolor[rgb]{{{}}}{{##1}}}}'.format(rgbcolor(ndef['color'])))
309
308
  if ndef['border']:
310
- cmndef += (r'\def\$$@bc##1{{\setlength{\fboxsep}{\string -\fboxrule}'
311
- r'\fcolorbox[rgb]{%s}{%s}{\strut ##1}}}' %
312
- (rgbcolor(ndef['border']),
309
+ cmndef += (r'\def\$$@bc##1{{{{\setlength{{\fboxsep}}{{\string -\fboxrule}}'
310
+ r'\fcolorbox[rgb]{{{}}}{{{}}}{{\strut ##1}}}}}}'.format(rgbcolor(ndef['border']),
313
311
  rgbcolor(ndef['bgcolor'])))
314
312
  elif ndef['bgcolor']:
315
- cmndef += (r'\def\$$@bc##1{{\setlength{\fboxsep}{0pt}'
316
- r'\colorbox[rgb]{%s}{\strut ##1}}}' %
317
- rgbcolor(ndef['bgcolor']))
313
+ cmndef += (r'\def\$$@bc##1{{{{\setlength{{\fboxsep}}{{0pt}}'
314
+ r'\colorbox[rgb]{{{}}}{{\strut ##1}}}}}}'.format(rgbcolor(ndef['bgcolor'])))
318
315
  if cmndef == '':
319
316
  continue
320
317
  cmndef = cmndef.replace('$$', cp)
@@ -329,7 +326,7 @@ class LatexFormatter(Formatter):
329
326
  cp = self.commandprefix
330
327
  styles = []
331
328
  for name, definition in self.cmd2def.items():
332
- styles.append(r'\@namedef{%s@tok@%s}{%s}' % (cp, name, definition))
329
+ styles.append(rf'\@namedef{{{cp}@tok@{name}}}{{{definition}}}')
333
330
  return STYLE_TEMPLATE % {'cp': self.commandprefix,
334
331
  'styles': '\n'.join(styles)}
335
332
 
@@ -410,10 +407,10 @@ class LatexFormatter(Formatter):
410
407
  spl = value.split('\n')
411
408
  for line in spl[:-1]:
412
409
  if line:
413
- outfile.write("\\%s{%s}{%s}" % (cp, styleval, line))
410
+ outfile.write(f"\\{cp}{{{styleval}}}{{{line}}}")
414
411
  outfile.write('\n')
415
412
  if spl[-1]:
416
- outfile.write("\\%s{%s}{%s}" % (cp, styleval, spl[-1]))
413
+ outfile.write(f"\\{cp}{{{styleval}}}{{{spl[-1]}}}")
417
414
  else:
418
415
  outfile.write(value)
419
416
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Other formatters: NullFormatter, RawTokenFormatter.
6
6
 
7
- :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
@@ -74,8 +74,7 @@ class RawTokenFormatter(Formatter):
74
74
  try:
75
75
  colorize(self.error_color, '')
76
76
  except KeyError:
77
- raise ValueError("Invalid color %r specified" %
78
- self.error_color)
77
+ raise ValueError(f"Invalid color {self.error_color!r} specified")
79
78
 
80
79
  def format(self, tokensource, outfile):
81
80
  try:
@@ -147,7 +146,7 @@ class TestcaseFormatter(Formatter):
147
146
  outbuf = []
148
147
  for ttype, value in tokensource:
149
148
  rawbuf.append(value)
150
- outbuf.append('%s(%s, %r),\n' % (indentation, ttype, value))
149
+ outbuf.append(f'{indentation}({ttype}, {value!r}),\n')
151
150
 
152
151
  before = TESTCASE_BEFORE % (''.join(rawbuf),)
153
152
  during = ''.join(outbuf)
@@ -4,7 +4,7 @@
4
4
 
5
5
  Formatter for Pango markup output.
6
6
 
7
- :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7
+ :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
8
8
  :license: BSD, see LICENSE for details.
9
9
  """
10
10
 
@@ -45,7 +45,7 @@ class PangoMarkupFormatter(Formatter):
45
45
  start = ''
46
46
  end = ''
47
47
  if style['color']:
48
- start += '<span fgcolor="#%s">' % style['color']
48
+ start += '<span fgcolor="#{}">'.format(style['color'])
49
49
  end = '</span>' + end
50
50
  if style['bold']:
51
51
  start += '<b>'