Cannot get the Markdown or HTML format to populate correctly a Google Doc

Hey there,

I am running a scenario with OpenAI modules to create a summary of text from different bundles, which then I aggregate into a single chunk of text. The output of the text is in Markdown format and I then use this to create a new google doc. However, the google doc is not reading the markdown format correctly (it’s keeping the ‘#’ in the text). I also tried adding a mardown-to-html module but like this I get a google doc full of html.

It’s strange because I have it working on another account and I can’t really understand what’s going on.

Can anyone help?

Welcome to the Make community!

You cannot use Markdown to create a new Google Doc.

You can only use HTML when creating a new Google Doc.

For updating, you cannot use HTML. You can get the current document’s HTML and append new HTML to a new Google Doc.

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

1 Like

Even if I use the markdown-to-html module to get the html, I get a google doc with the actual html instead of a formatted doc. What can I do to solve this?

You can only use HTML when creating a new Google Doc.

1 Like

You have to use the download document module in Google Docs app and use the HTML to get the existing HTML and then append your new Markdown->HTML formatted content and then CREATE a new document from that combination…

Here’s the snapshow of the Download a Document module that shows how to format in HTML

Once you do this you can use the downloaded HTML and append more HTML in the Create a Document module

Here's a sample scenario that shows how to do this
{
    "subflows": [
        {
            "flow": [
                {
                    "id": 1,
                    "module": "util:SetVariables",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "variables": [
                            {
                                "name": "markdown",
                                "value": "# An H1 Header\n## An H2 Header\n### An H3 Header\n#### An H4 Header\n\n* Item 1\n* Item 2\n* Item 3\n\nMore text"
                            }
                        ],
                        "scope": "roundtrip"
                    },
                    "metadata": {
                        "designer": {
                            "x": 0,
                            "y": 0
                        },
                        "restore": {
                            "expect": {
                                "variables": {
                                    "items": [
                                        null
                                    ]
                                },
                                "scope": {
                                    "label": "One cycle"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "variables",
                                "type": "array",
                                "label": "Variables",
                                "spec": [
                                    {
                                        "name": "name",
                                        "label": "Variable name",
                                        "type": "text",
                                        "required": true
                                    },
                                    {
                                        "name": "value",
                                        "label": "Variable value",
                                        "type": "any"
                                    }
                                ]
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            }
                        ],
                        "interface": [
                            {
                                "name": "markdown",
                                "label": "markdown",
                                "type": "any"
                            }
                        ]
                    }
                },
                {
                    "id": 2,
                    "module": "markdown:Compile",
                    "version": 2,
                    "parameters": {},
                    "mapper": {
                        "data": "{{1.markdown}}",
                        "gfm": true,
                        "sanitize": false
                    },
                    "metadata": {
                        "designer": {
                            "x": 300,
                            "y": 0
                        },
                        "restore": {
                            "expect": {
                                "gfm": {
                                    "mode": "chose"
                                },
                                "sanitize": {
                                    "mode": "chose"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "data",
                                "type": "text",
                                "label": "Markdown"
                            },
                            {
                                "name": "gfm",
                                "type": "boolean",
                                "label": "GitHub Flavored Markdown",
                                "required": true
                            },
                            {
                                "name": "sanitize",
                                "type": "boolean",
                                "label": "Sanitize",
                                "required": true
                            }
                        ]
                    }
                },
                {
                    "id": 12,
                    "module": "google-docs:createADocument",
                    "version": 1,
                    "parameters": {
                        "__IMTCONN__": 648527
                    },
                    "mapper": {
                        "name": "test document",
                        "content": "{{2.data}}",
                        "destination": "drive",
                        "header": false,
                        "footer": false,
                        "folderId": "/1xDKsySmZ4XU-vW06k-Dua8pKbpxHAoJK"
                    },
                    "metadata": {
                        "designer": {
                            "x": 600,
                            "y": 0
                        },
                        "restore": {
                            "parameters": {
                                "__IMTCONN__": {
                                    "label": "NewPath Google connection (alexs@newpathconsulting.com)",
                                    "data": {
                                        "scoped": "true",
                                        "connection": "google"
                                    }
                                }
                            },
                            "expect": {
                                "destination": {
                                    "label": "My Drive"
                                },
                                "folderId": {
                                    "mode": "chose",
                                    "path": [
                                        "WA Reports"
                                    ]
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "__IMTCONN__",
                                "type": "account:google",
                                "label": "Connection",
                                "required": true
                            }
                        ],
                        "expect": [
                            {
                                "name": "name",
                                "type": "text",
                                "label": "Name",
                                "required": true
                            },
                            {
                                "name": "content",
                                "type": "text",
                                "label": "Content",
                                "required": true
                            },
                            {
                                "name": "destination",
                                "type": "select",
                                "label": "Choose a Drive",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "drive",
                                        "share",
                                        "team"
                                    ]
                                }
                            },
                            {
                                "name": "header",
                                "type": "boolean",
                                "label": "Insert a Header",
                                "required": true
                            },
                            {
                                "name": "footer",
                                "type": "boolean",
                                "label": "Insert a Footer",
                                "required": true
                            },
                            {
                                "name": "folderId",
                                "type": "folder",
                                "label": "New Document's Location",
                                "required": true
                            }
                        ]
                    }
                },
                {
                    "id": 18,
                    "module": "google-docs:exportADocument",
                    "version": 1,
                    "parameters": {
                        "__IMTCONN__": 648527
                    },
                    "mapper": {
                        "destination": "drive",
                        "mimeType": "text/html",
                        "document": "{{12.id}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 900,
                            "y": 0
                        },
                        "restore": {
                            "parameters": {
                                "__IMTCONN__": {
                                    "label": "NewPath Google connection (alexs@newpathconsulting.com)",
                                    "data": {
                                        "scoped": "true",
                                        "connection": "google"
                                    }
                                }
                            },
                            "expect": {
                                "destination": {
                                    "label": "My Drive"
                                },
                                "mimeType": {
                                    "mode": "chose",
                                    "label": "HTML Format (.html)"
                                },
                                "document": {
                                    "mode": "edit",
                                    "path": []
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "__IMTCONN__",
                                "type": "account:google",
                                "label": "Connection",
                                "required": true
                            }
                        ],
                        "expect": [
                            {
                                "name": "destination",
                                "type": "select",
                                "label": "Choose a Drive",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "drive",
                                        "share",
                                        "team"
                                    ]
                                }
                            },
                            {
                                "name": "mimeType",
                                "type": "select",
                                "label": "Type",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                                        "application/vnd.oasis.opendocument.text",
                                        "application/rtf",
                                        "application/pdf",
                                        "text/plain",
                                        "text/html",
                                        "application/epub+zip"
                                    ]
                                }
                            },
                            {
                                "name": "document",
                                "type": "file",
                                "label": "Document ID",
                                "required": true
                            }
                        ]
                    }
                },
                {
                    "id": 19,
                    "module": "google-docs:createADocument",
                    "version": 1,
                    "parameters": {
                        "__IMTCONN__": 648527
                    },
                    "mapper": {
                        "name": "test document",
                        "content": "existing data\n{{18.data}}\nnew data\n{{2.data}}",
                        "destination": "drive",
                        "header": false,
                        "footer": false,
                        "folderId": "/1xDKsySmZ4XU-vW06k-Dua8pKbpxHAoJK"
                    },
                    "metadata": {
                        "designer": {
                            "x": 1200,
                            "y": 0
                        },
                        "restore": {
                            "parameters": {
                                "__IMTCONN__": {
                                    "label": "NewPath Google connection (alexs@newpathconsulting.com)",
                                    "data": {
                                        "scoped": "true",
                                        "connection": "google"
                                    }
                                }
                            },
                            "expect": {
                                "destination": {
                                    "label": "My Drive"
                                },
                                "folderId": {
                                    "mode": "chose",
                                    "path": [
                                        "WA Reports"
                                    ]
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "__IMTCONN__",
                                "type": "account:google",
                                "label": "Connection",
                                "required": true
                            }
                        ],
                        "expect": [
                            {
                                "name": "name",
                                "type": "text",
                                "label": "Name",
                                "required": true
                            },
                            {
                                "name": "content",
                                "type": "text",
                                "label": "Content",
                                "required": true
                            },
                            {
                                "name": "destination",
                                "type": "select",
                                "label": "Choose a Drive",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "drive",
                                        "share",
                                        "team"
                                    ]
                                }
                            },
                            {
                                "name": "header",
                                "type": "boolean",
                                "label": "Insert a Header",
                                "required": true
                            },
                            {
                                "name": "footer",
                                "type": "boolean",
                                "label": "Insert a Footer",
                                "required": true
                            },
                            {
                                "name": "folderId",
                                "type": "folder",
                                "label": "New Document's Location",
                                "required": true
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}
1 Like

I’m sorry I think I didn’t explain properly.

I am converting the text from the “aggregate text” module from markdown to HTML. However, when creating a new google doc, it simply adds the html as text without any formatting:

This is the document it creates:

This is the input from the markdown-to-html module:

And this is the output from the same module:

This is the whole scenario:

Thank you for the screenshots.

The next issue I can see from your screenshot is, the content of the document needs to be formatted as a complete HTML document, or at least the html and body tag.

e.g.:

<html>
<body>

Body HTML goes here...

</body>
</html>

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

2 Likes

Share your markdown here and I’ll test to see – maybe there is something in the HTML that is non-standard and it breaks when creating a document.

1 Like

Example markdown given as input to the markdown-to-html module:

Las largas sombras de la creciente deuda de América

Lea el artículo completo

Resumen corto (70 palabras)
Ignorar la creciente deuda de los EE.UU. es como jugar Jenga financiero sin tener idea de cuándo se derrumbará la torre. Esta negligencia pone en riesgo no solo el crecimiento económico, sino también la estabilidad de todo el sistema. Los estadounidenses necesitan despertar ante la crisis inminente, ya que las repercusiones de una deuda desenfrenada podrían remodelar el futuro de la nación. Es hora de un cambio estratégico para salvaguardar el mañana.

Resumen largo (180 palabras)
La saga de la deuda de América es el elefante en la habitación que sigue comiendo, amenazando con derribar la casa si no se aborda. Ignorar el problema parece ser un deporte nacional, pero los riesgos son altísimos: la economía y la estabilidad están en juego. La deuda de los EE. UU., que ha aumentado a niveles asombrosos, no es solo un número; es una bomba de tiempo que podría alterar la vida de personas, empresas y operaciones gubernamentales.

Note: This is how I pasted in the text on here. As you can see it got converted automatically:

I cannot map or force the markdown-to-html module to output a specific format unfortunately. What can I do?

In your Google Docs “Create a Document” Content field,

Insert the format/tags in my previous post.

1 Like

I get the following:

This is what I have the content section of the google doc module:

escape the markdown please with ```

the community forum is parsing the Markdown for you

1 Like
## Las largas sombras de la creciente deuda de América
[Lea el artículo completo](https://www.ft.com/content/29b43684-261c-4b5b-af7d-ab72c7c06a38)

**Resumen corto (70 palabras)**  
Ignorar la creciente deuda de los EE.UU. es como jugar Jenga financiero sin tener idea de cuándo se derrumbará la torre. Esta negligencia pone en riesgo no solo el crecimiento económico, sino también la estabilidad de todo el sistema. Los estadounidenses necesitan despertar ante la crisis inminente, ya que las repercusiones de una deuda desenfrenada podrían remodelar el futuro de la nación. Es hora de un cambio estratégico para salvaguardar el mañana.

**Resumen largo (180 palabras)**  
La saga de la deuda de América es el elefante en la habitación que sigue comiendo, amenazando con derribar la casa si no se aborda. Ignorar el problema parece ser un deporte nacional, pero los riesgos son altísimos: la economía y la estabilidad están en juego. La deuda de los EE. UU., que ha aumentado a niveles asombrosos, no es solo un número; es una bomba de tiempo que podría alterar la vida de personas, empresas y operaciones gubernamentales.

A medida que la deuda crece, también lo hacen los desafíos para manejarla. Cada dólar que se endeuda ahora es una cadena alrededor del tobillo de las futuras generaciones, lo que podría arrastrar su prosperidad y oportunidades. Es urgente la necesidad de un plan sólido para abordar esta deuda, pero la voluntad política parece tan esquiva como un espejismo en el desierto. Sin intervenciones serias, los EE. UU. corren el riesgo de enfrentar un escenario en el que podría tener que elegir entre medidas de austeridad dolorosas o un colapso financiero descontrolado.

Este es un momento crítico para que los legisladores den un paso al frente y tracen un rumbo que evite el desastre. Esto no es solo equilibrar libros; Es asegurar un futuro estable y próspero para todos los estadounidenses. El reloj está corriendo, ¿Alguien está escuchando?

I’ve confirmed that the HTML your Markdown is generating is just being put into the Google Doc. I turned on “show advanced settings” in the Markdown to HTML module and configured it as such with the highlighted green toggles.

And voila, things worked out much better and the google doc has the correct formatting now.

Here’s what I get now

5 Likes

that worked for me too! Thanks so much!

3 Likes