p00f / cphelper.nvim

Neovim helper for competitive programming. Use https://sr.ht/~p00f/cphelper.nvim instead
MIT License
133 stars 9 forks source link

Reads Grepper html code. #9

Closed anurag3301 closed 3 years ago

anurag3301 commented 3 years ago

The plugin reads the Grepper extension's HTML code and add that to input and output

https://user-images.githubusercontent.com/52702259/127300748-87b5adc7-2286-488e-b5b0-b6d0136fcc78.mp4

p00f commented 3 years ago

Which extension is that (grepper)?

p00f commented 3 years ago

In any case, this issue should be filed with the browser extension https://github.com/jmerle/competitive-companion. This plugin simply writes the output of the extension to files

p00f commented 3 years ago

If the extension author refuses to fix this (because you are using another extension), I'll try to fix this on my end

anurag3301 commented 3 years ago

Sure, I think you can just check for that line and remove that completely. And you can give the user option to turn on or off this feature

p00f commented 3 years ago

I think you can just check for that line and remove that completely.

The output of the extension is still "wrong" though

p00f commented 3 years ago

Until the extension is fixed you can change https://github.com/p00f/cphelper.nvim/blob/90b63f8a2557c39702b63c240188f12dcfe3ef54/lua/cphelper/prepare.lua#L25-L28 to

    for i, test in pairs(tests) do
        local input = test["input"]
        input = string.gsub(input, "\n<div class .....>", "")
        local output = test["output"]
        output = string.gsub(output, "\n<div class .....>", "")
        problem_dir:joinpath("input" .. i):write(input, "w")
        problem_dir:joinpath("output" .. i):write(output, "w")
    end
anurag3301 commented 3 years ago

Got it, Thanks, buddy.

jmerle commented 3 years ago

I fixed the issue in Competitive Companion 2.25.6 which has just gone live. Your browser should auto-update the extension within 24 hours.