Giter VIP home page Giter VIP logo

markdown-it-replacements's Introduction

Projects

I lead (🌟) and/or contribute to (πŸ‘―) the following open-source projects and documents, some of which are forks (🍴):

markdown-it-replacements's People

Contributors

edemaine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

markdown-it-replacements's Issues

html entity in replace

Hi there,
thanks for this great tool.

i’m trying to add HTMLΒ entities (trying to make a french typographer plugin, for which i’d like to have html element around (span basically) but everything is escaped, like this:
Β 

mir.replacements.push({
  name: "thoushand",
  re: /(\d)([ | ])(\d)/gi,
  sub: '$1\<span class=\"th\"\>\u2009\<\/span\>$2',
  default: true,
});

get transformed into

this is fine 199<span class="th"> </span> 00

Is there a simple way to avoid this?

Thanks!

Rendering issue

md.use(mir);
      mir.replacements.push({
        name: 'table-replacement',
        re: /<enapter:blueprint-alerts-table \/>/g,
        sub: function() {
          const yamlFilePath = path.resolve(__dirname, '../electrolyser/el40/data.yaml');
          const yamlContent = fs.readFileSync(yamlFilePath, 'utf8');
          const data = yaml.safeLoad(yamlContent);
          const alerts = Array.isArray(data.alerts) ? data.alerts : [];

          const openingTags = '```html\n' + `
            <table>
              <thead>
                <tr>
                  <th id="alerts_code">Code</th>
                  <th id="alerts_name">Name</th>
                  <th id="alert_severityCode">Severity Code</th>
                  <th id="alerts_routineCode">Routine Code</th>
                  <th id="alerts_component">Component</th>
                  <th id="alerts_condition">Condition</th>
                  <th id="alerts_displayName">Display Name</th>
                  <th id="alerts_description">Description</th>
                  <th id="alerts_troubleshooting">Troubleshooting</th>
                </tr>
              </thead>
              <tbody>`;

          const enclosingTags = '</tbody>\n</table>\n' + '```';

          const tableRows = [];

          for (const alert of alerts) {
            tableRows.push(`
              <tr>
                <td>${alert.name}</td>
                <td>${alert.description}</td>
                <td>${alert.severity}</td>
                <td>${alert.routine}</td>
                <td>${alert.component ? alert.component.join('<br>') : '&mdash;'}</td>
                <td>${alert.condition ? alert.condition.join('<br>') : '&mdash;'}</td>
                <td>${alert.display_name}</td>
                <td>${alert.description}</td>
                <td>${alert.troubleshooting ? alert.troubleshooting.join('<br>') : '&mdash;'}</td>
              </tr>
            `);
          }

          return [openingTags, ...tableRows, enclosingTags].join('\n');
        },
        default: true,
      });

can someone help me to understand where i made a mistake that my tables not rendered correctly it renderes like this

<table> <thead> <tr> <th id="alerts_code">Code</th> <th id="alerts_name">Name</th> <th id="alert_severityCode">Severity Code</th> <th id="alerts_routineCode">Routine Code</th> <th id="alerts_component">Component</th> <th id="alerts_condition">Condition</th> <th id="alerts_displayName">Display Name</th> <th id="alerts_description">Description</th> <th id="alerts_troubleshooting">Troubleshooting</th> </tr> </thead> <tbody> </tbody> </table>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.