Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"composite": true,
"outDir": "dist",
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
Copy link
Contributor

@alysonturing alysonturing May 10, 2023

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
Loading