Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tinymce/moxiedoc

Package Overview
Dependencies
Maintainers
2
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinymce/moxiedoc - npm Package Compare versions

Comparing version 0.2.0-feature.20220319035257520.shaac589ca to 0.2.0-feature.20220326065652519.shac1bbb7f

21

dist/templates/antora/antora.converter.js

@@ -22,6 +22,6 @@ "use strict";

const encodeBR = (str) => str.replace(/<br\s*\/?>/g, '\n');
// convert <em> into _italics_ asciidoc
const encodeEM = (str) => str.replace(/<\/?em>/g, '_');
// convert <strong> into *bold* asciidoc
const encodeStrong = (str) => str.replace(/<\/?strong>/g, '*');
// convert <em> into __italics__ asciidoc
const encodeEM = (str) => str.replace(/<\/?em>/g, '__');
// convert <strong> into **bold** asciidoc
const encodeStrong = (str) => str.replace(/<\/?strong>/g, '**');
// convert <code> into backtick asciidoc

@@ -47,7 +47,16 @@ const encodeCode = (str) => {

};
// escape special asciidoc characters
const specialChars = {
'|': '{vbar}',
'+': '{plus}',
'*': '{asterisk}'
};
const escapeSpecialChars = (str) => str.replace(/[|+*]/g, (match) => specialChars[match] || match);
// convert content that looks like asciidoc attributes (e.g {0}) to literal strings
const escapeAttributes = (str) => str.replace(/(\{\s*[\w\d-]+\s*\})/g, '+$1+');
// Note: Special characters should not be escaped
const specialAttrs = Object.values(specialChars);
const escapeAttributes = (str) => str.replace(/(\{\s*[\w\d-]+\s*\})/g, (match) => specialAttrs.indexOf(match) !== -1 ? match : `+${match}+`);
// runs a bunch of required cleanup filters, where embedded code/text can break asciidoc rendering
const cleanup = (str) => {
const filters = [escapeComments, encodeBR, encodeEM, encodeStrong, encodeLinks, encodeCode, escapeAttributes];
const filters = [escapeSpecialChars, escapeAttributes, escapeComments, encodeBR, encodeEM, encodeStrong, encodeLinks, encodeCode];
return filters.reduce((acc, filter) => filter(acc), str);

@@ -54,0 +63,0 @@ };

{
"name": "@tinymce/moxiedoc",
"version": "0.2.0-feature.20220319035257520.shaac589ca",
"version": "0.2.0-feature.20220326065652519.shac1bbb7f",
"description": "A tool for generating API documentation",

@@ -5,0 +5,0 @@ "author": "Tiny Technologies, Inc",

@@ -32,9 +32,9 @@ import { Return } from '../../lib/member';

// convert <em> into _italics_ asciidoc
// convert <em> into __italics__ asciidoc
const encodeEM = (str: string): string =>
str.replace(/<\/?em>/g, '_');
str.replace(/<\/?em>/g, '__');
// convert <strong> into *bold* asciidoc
// convert <strong> into **bold** asciidoc
const encodeStrong = (str: string): string =>
str.replace(/<\/?strong>/g, '*');
str.replace(/<\/?strong>/g, '**');

@@ -62,9 +62,20 @@ // convert <code> into backtick asciidoc

// escape special asciidoc characters
const specialChars = {
'|': '{vbar}',
'+': '{plus}',
'*': '{asterisk}'
};
const escapeSpecialChars = (str: string): string =>
str.replace(/[|+*]/g, (match) => specialChars[match] || match);
// convert content that looks like asciidoc attributes (e.g {0}) to literal strings
// Note: Special characters should not be escaped
const specialAttrs = Object.values(specialChars);
const escapeAttributes = (str: string): string =>
str.replace(/(\{\s*[\w\d-]+\s*\})/g, '+$1+');
str.replace(/(\{\s*[\w\d-]+\s*\})/g, (match) => specialAttrs.indexOf(match) !== -1 ? match : `+${match}+`);
// runs a bunch of required cleanup filters, where embedded code/text can break asciidoc rendering
const cleanup = (str: string): string => {
const filters = [ escapeComments, encodeBR, encodeEM, encodeStrong, encodeLinks, encodeCode, escapeAttributes ];
const filters = [ escapeSpecialChars, escapeAttributes, escapeComments, encodeBR, encodeEM, encodeStrong, encodeLinks, encodeCode ];
return filters.reduce((acc, filter) => filter(acc), str);

@@ -71,0 +82,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc