Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): fix line num for HTML generation #279

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

EmileRolley
Copy link
Collaborator

Fix line numbering for the Html backend.

Catala code block delimiters are removed after the pygmentization and this must be taken into account for the line numbering.

let return_code = Sys.command cmd in
if return_code <> 0 then raise_failed_pygments cmd return_code;
let oc = open_in temp_file_out in
let output = really_input_string oc (in_channel_length oc) in
close_in oc;
(* Remove code blocks delimiters needed by [Pygments]. *)
let trimmed_output =
output |> remove_cb_first_lines |> remove_cb_last_lines
in

@EmileRolley EmileRolley added ❌ bug Something isn't working 🔧 compiler Issue concerns the compiler 🔚 backends Backend runtime or code generation labels Jun 8, 2022
Copy link
Contributor

@denismerigoux denismerigoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you !

@denismerigoux denismerigoux merged commit 925eeff into master Jun 8, 2022
@EmileRolley EmileRolley deleted the fix-line-num branch June 9, 2022 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔚 backends Backend runtime or code generation ❌ bug Something isn't working 🔧 compiler Issue concerns the compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants