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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Convert HTML to Markdown Unexpected token '||=' #6220 #6349

Merged
merged 1 commit into from May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,13 +1,13 @@
import { defineAction } from "@pipedream/types";
import { parseHTML } from "linkedom";
import showdown from "showdown";
import jsdom from "jsdom";
import app from "../../app/formatting.app";

export default defineAction({
name: "[Text] Convert HTML to Markdown",
description: "Convert valid HTML to Markdown text",
key: "formatting-convert-html-to-markdown",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand All @@ -20,7 +20,7 @@ export default defineAction({
async run({ $ }): Promise<string> {
const { input } = this;
const converter = new showdown.Converter();
const dom = new jsdom.JSDOM();
const dom = parseHTML("");
const result = converter.makeMarkdown(input, dom.window.document);

$.export("$summary", "Successfully converted to Markdown");
Expand Down
@@ -1,13 +1,13 @@
import { defineAction } from "@pipedream/types";
import showdown from "showdown";
import jsdom from "jsdom";
import { parseHTML } from "linkedom";
import app from "../../app/formatting.app";

export default defineAction({
name: "[Text] Convert Markdown to HTML",
description: "Convert Markdown text to HTML",
key: "formatting-convert-markdown-to-html",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand All @@ -20,7 +20,7 @@ export default defineAction({
async run({ $ }): Promise<string> {
const { input } = this;
const converter = new showdown.Converter();
const dom = new jsdom.JSDOM();
const dom = parseHTML("");
const result = converter.makeHtml(input, dom.window.document);

$.export("$summary", "Successfully converted to HTML");
Expand Down
4 changes: 2 additions & 2 deletions components/formatting/package.json
@@ -1,6 +1,6 @@
{
"name": "@pipedream/formatting",
"version": "0.0.2",
"version": "0.0.3",
"description": "Pipedream Formatting Components",
"main": "dist/app/formatting.app.mjs",
"keywords": [
Expand All @@ -19,7 +19,7 @@
"dependencies": {
"@pipedream/platform": "^1.2.1",
"@pipedream/types": "^0.1.4",
"jsdom": "^21.1.0",
"linkedom": "^0.14.26",
"pluralize": "^8.0.0",
"showdown": "^2.1.0",
"title-case": "^3.0.3"
Expand Down
1 change: 1 addition & 0 deletions components/formatting/tsconfig.json
Expand Up @@ -8,6 +8,7 @@
"composite": true,
"outDir": "dist",
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was required to use linkedom package
reference

},
"allowJs": true,
"include": [
Expand Down