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

enketo-transformer

Package Overview
Dependencies
Maintainers
3
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enketo-transformer - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

test/forms/bold-media.xml

6

CHANGELOG.md

@@ -6,2 +6,8 @@ ## Change Log

## [2.1.4] - 2022-05-04
##### Changed
- Fixed mangling of markdown-produced HTML next to top-level text nodes when a mediamap is provided (#150)
## [2.1.3] - 2022-04-21

@@ -8,0 +14,0 @@

6

package.json
{
"name": "enketo-transformer",
"version": "2.1.3",
"version": "2.1.4",
"description": "Library/app that transforms ODK-compliant XForms into a format that Enketo can consume",

@@ -65,3 +65,3 @@ "license": "Apache-2.0",

"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-unicorn": "^36.0.0",

@@ -75,3 +75,3 @@ "grunt": "^1.5.2",

"mocha": "^9.2.2",
"nodemon": "^2.0.15",
"nodemon": "^2.0.16",
"nyc": "^15.1.0",

@@ -78,0 +78,0 @@ "prettier": "^2.6.2",

@@ -1,2 +0,2 @@

![coverage-shield-badge-1](https://img.shields.io/badge/coverage-97.86%25-brightgreen.svg)
![coverage-shield-badge-1](https://img.shields.io/badge/coverage-98.31%25-brightgreen.svg)
[![npm version](https://badge.fury.io/js/enketo-transformer.svg)](http://badge.fury.io/js/enketo-transformer) [![Build Status](https://travis-ci.org/enketo/enketo-transformer.svg?branch=master)](https://travis-ci.org/enketo/enketo-transformer) [![Dependency Status](https://david-dm.org/enketo/enketo-transformer.svg)](https://david-dm.org/enketo/enketo-transformer)

@@ -3,0 +3,0 @@

@@ -83,8 +83,12 @@ /**

const mediaMap = Object.fromEntries(
Object.entries(survey.media || {}).map((entry) =>
entry.map(escapeURLPath)
)
);
let mediaMap = null;
if (survey.media) {
mediaMap = Object.fromEntries(
Object.entries(survey.media).map((entry) =>
entry.map(escapeURLPath)
)
);
}
return _parseXml(survey.xform)

@@ -502,8 +506,11 @@ .then((doc) => {

if (mediaMap != null) {
const fragment = libxmljs.parseHtmlFragment(rendered);
const fragment = libxmljs.parseHtmlFragment(
`<div class="temporary-root">${rendered}</div>`
);
rendered = _replaceMediaSources(
fragment,
mediaMap
).toString(false);
rendered = _replaceMediaSources(fragment, mediaMap)
.root()
.childNodes()
.map((node) => node.toString(false))
.join('');
}

@@ -510,0 +517,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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