We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the issue Some code of cpp can not be rendered.
Which language seems to have the issue? cpp
Are you using highlight or highlightAuto?
highlight
highlightAuto
...
Sample Code to Reproduce
#include <iostream> #include <Eigen/Core> int main(int argc, char** argv) { //1.方阵 Eigen::Matrix3f A; //本质是Eigen::Matrix<float,3,3> A; A << 1,2,3,4,5,6,7,8,9; std::cout << "A= \n" << A << std::endl; //2. 转置操作 Eigen::Matrix3f A_T = A.transpose(); std::cout << "\nA的转置矩阵A_T= \n" << A_T << std::endl; //3. 零矩阵 Eigen::Matrix<float,3,5> B = Eigen::Matrix<float,3,5>::Zero(); std::cout << "\nB= \n" << B << std::endl; //4. 对角矩阵 //4.1 构造对角矩阵 Eigen::VectorXd vector(5); //构建5维向量 vector<<1,2,3,4,5; //向量赋值 Eigen::MatrixXd C(vector.asDiagonal()); //使用向量生成对角阵 std::cout << "\nC= \n" << C << std::endl; //4.2 从普通矩阵中提取对角元素组成向量 std::cout << "\n从C中提取对角元素构成向量= \n" << C.diagonal() << std::endl; //C也可以不是方阵 //5. 单位矩阵 //5.1 构造单位矩阵 Eigen::Matrix3f D = Eigen::Matrix3f::Identity(); //简写 Eigen::Matrix<float,4,4> E = Eigen::Matrix<float,4,4>::Identity(); //完整写法 std::cout << "\n单位矩阵D= \n" << D << std::endl; std::cout << "\n单位矩阵E= \n" << E << std::endl; //5.2 构造对角线为1的普通矩阵 Eigen::Matrix<float,3,5> F = Eigen::Matrix<float,3,5>::Identity(); std::cout << "\n普通对角元素为1的矩阵F= \n" << F << std::endl; return 0; }
Expected behavior
Additional context Code:
element.innerHTML = hljs.highlight(code, { language: "cpp", ignoreIllegals: true }).value;
The text was updated successfully, but these errors were encountered:
@Vanessa219 Could you test or review PR fix?
Sorry, something went wrong.
It works, thank you.
Successfully merging a pull request may close this issue.
Describe the issue
Some code of cpp can not be rendered.
Which language seems to have the issue?
cpp
Are you using
highlight
orhighlightAuto
?highlight
...
Sample Code to Reproduce
Expected behavior
Additional context
Code:
The text was updated successfully, but these errors were encountered: