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

feat(viewer): decode safe mathml #861

Merged
merged 1 commit into from
Nov 30, 2023
Merged

feat(viewer): decode safe mathml #861

merged 1 commit into from
Nov 30, 2023

Conversation

icaparros-at-wiris
Copy link
Contributor

Description

This PR update the viewer in order to decode Safe MathML to MathML. This is necesary for moodle filter plugin as the safe mathml rendering from Moodle is not working when using the new viewer.

Steps to reproduce

  1. Use wiris-moodle-docker and deploy MOODLE_403_STABLE.
  2. Configure MathType filter to use the render option: Client.
  3. If you have moodle volume on /html/var/MOODLE_403_STABLE you can use this webpack.config.js example to build viewer directly to the moodle-filter_wiris plugin:
const path = require('path');

module.exports = (config, context) => {
  return {
    entry: './src/app.ts',
    mode: 'none',
    devtool: 'inline-source-map',
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          use: 'ts-loader',
          exclude: /node_modules/,
        },
        {
          test: /\.js$/,
          exclude: /node_modules/,
          use: ['babel-loader']
        },
      ],
    },
    resolve: {
      extensions: ['.tsx', '.ts', '.js'],
    },
    output: {
      filename: 'WIRISplugins.js',
      path: '/var/www/MOODLE_403_STABLE/filter/wiris/render',
    },
    devServer: {
      devMiddleware: {
        writeToDisk: true,
      },
      static:  './',
      hot: true,
      port: 8001,
      open: true,
    },
    optimization: {
      minimize: false, // enabling this reduces file size and readability
    },
  }
};
  1. On html-integrations run the next commands to build the viewer:
yarn
nx build viewer
  1. Create a course or task with some Math formula with on the description.
  2. Check If is rendered correctly.

#taskid 40011

@xripoll-at-wiris xripoll-at-wiris merged commit 77c9558 into master Nov 30, 2023
@xripoll-at-wiris xripoll-at-wiris deleted the KB-40011b branch November 30, 2023 09:11
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

Successfully merging this pull request may close these issues.

3 participants