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

CodeRay hangs on multi-code in content #236

Open
EnziinSystem opened this issue May 11, 2019 · 0 comments
Open

CodeRay hangs on multi-code in content #236

EnziinSystem opened this issue May 11, 2019 · 0 comments

Comments

@EnziinSystem
Copy link

EnziinSystem commented May 11, 2019

Hello,

I have content with multi-source code programming:

// This is a C code block
#include <stdio.h>

int main()
{
    int n, i;
    unsigned long long factorial = 1;

    printf(\"Enter an integer: \\n\");
    scanf(\"%d\",&n);

    if (n < 0)
        printf(\"Error! Factorial of a negative number doesn't exist.\");
    else
    {
        for(i=1; i<=n; ++i)
        {
            factorial *= i;              // factorial = factorial*i;
        }
        printf(\"Factorial of %d = %llu\", n, factorial);
    }

    return 0;
}
// This is the Ruby code
class PagesController < ApplicationController
  require 'will_paginate/array'
  require 'net/http'
  require 'open-uri'
  require 'securerandom'

  def editor
    @language_code = params[:language_code]
    @source_code = CodeBlock.where(id: params[:id], language_code: @language_code).first

    @language_code = 7 unless @language_code.present?
    unless @source_code.present?
      @example = "#include <iostream>\n\nusing namespace std;\n\nint main() {\n\n\tcout << \"Hello from C/C++\";\n\n\treturn 0;\n}"
    end
    @authenticity_token = form_authenticity_token
    @code_blocks = current_user.code_blocks if user_signed_in?
  end
end

The description text content with multi-language needs to introduction about the large system.

But, when I render the above code, CodeRay hangs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant