mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-06 20:56:42 +08:00
Escape underscores when sending ZPL to render service [SCI-7223] (#4456)
This commit is contained in:
parent
5a06a685aa
commit
8c2f7da87f
1 changed files with 7 additions and 1 deletions
|
@ -17,7 +17,7 @@ class LabelTemplatesPreviewService
|
|||
invocation_type: 'RequestResponse',
|
||||
log_type: 'Tail',
|
||||
payload:
|
||||
"{ \"content\": #{@params[:zpl].to_json},"\
|
||||
"{ \"content\": #{sanitize_zpl_code(@params[:zpl]).to_json},"\
|
||||
"\"width\": #{@params[:width]},"\
|
||||
"\"height\": #{@params[:height]},"\
|
||||
"\"density\": #{@params[:density]} "\
|
||||
|
@ -30,4 +30,10 @@ class LabelTemplatesPreviewService
|
|||
@error = resp.function_error.string
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def sanitize_zpl_code(zpl_code)
|
||||
zpl_code.gsub!('_', '_5F')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue