asciidoctor-latexmath 2.0.0.alpha.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29ce5a1a06289846344cb4d2ee9517e2b111953db7622641cf6e5f3381bb2e22
|
4
|
+
data.tar.gz: 4fec6a20f4a0cb2031c1eeefb7db0223cdfcf1d2912bc4aa09dfe0e97ddd939f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e5f299a442fa6690968c0d6af098e4d5343b4f03ca32d1d8d4c7596d912015bae804bd2480c147e14599d8a8908b0251f08c25b45469610e9d0967db82f3a45
|
7
|
+
data.tar.gz: 440d246a9f510ba1e7fa2ed5341d48c7508428df0f02118b6101b32a704d0d0e6007e8ea1c56378e3fdad55a9cf4cf16bfe86249dcb4d9308547f3b7fd3c9c1f
|
@@ -234,10 +234,8 @@ module Asciidoctor
|
|
234
234
|
|
235
235
|
def render_without_cache(document_obj, request, paths, raw_attrs, expression)
|
236
236
|
start = monotonic_time
|
237
|
-
generated_path = nil
|
238
237
|
|
239
238
|
generate_artifact(request, paths.basename, raw_attrs) do |output_path, artifact_dir, _tool_presence|
|
240
|
-
generated_path = output_path
|
241
239
|
copy_to_target(output_path, paths.final_path, overwrite: true)
|
242
240
|
persist_artifacts(request, artifact_dir, success: true)
|
243
241
|
end
|
@@ -482,12 +480,21 @@ module Asciidoctor
|
|
482
480
|
stdout: "",
|
483
481
|
stderr: error.message,
|
484
482
|
source: expression.content,
|
485
|
-
latex_source:
|
483
|
+
latex_source: safe_latex_document_for(request)
|
486
484
|
)
|
487
485
|
|
488
486
|
Result.new(type: :placeholder, placeholder_html: placeholder_html, format: request.format)
|
489
487
|
end
|
490
488
|
|
489
|
+
def safe_latex_document_for(request)
|
490
|
+
build_latex_document(request)
|
491
|
+
rescue => document_error
|
492
|
+
logger&.warn do
|
493
|
+
"latexmath failed to reconstruct LaTeX document for placeholder: #{document_error.message}"
|
494
|
+
end
|
495
|
+
request&.expression&.content || ""
|
496
|
+
end
|
497
|
+
|
491
498
|
def copy_to_target(source, destination, overwrite: true)
|
492
499
|
return destination if !overwrite && File.exist?(destination)
|
493
500
|
|