Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Docx to HTML Convert tool

Security covered Under active development 25 sites

This module converts content from Docx files into HTML using a front-end solution, preserving styling. It allows users to paste Docx content into any long text field without uploading files to the server. The converted HTML can be previewed and copied to the clipboard.

The Docx to HTML Convert Tool module provides a purely front-end solution powered by mammoth.js to convert content from Docx to HTML. Since CKEditor 5, the 'Paste from Word (Office)' feature has been limited in its free version. This module allows content authors to copy content from a Docx file and paste it into any long text field, preserving as much of the original styling as possible.

Features

  • Front-end solution, no file uploaded to the server.
  • Converted HTML content can be pasted to any long text field
  • Preview converted content rendered with current front theme.
  • Support following styling copied from a docx file.
    • Headings.
    • Lists.
    • Customisable mapping.
    • Tables.
    • Footnotes and endnotes.
    • Images.
    • Bold, italics, underlines, strikethrough, superscript and subscript.
    • Links.
    • Line breaks.
    • Text boxes.
    • Comments.
    • And more to come

Post-Installation

The mammoth.js 1.8.0 has already been included in this module. No need to install it separately.

How to use?

  1. Enable the module.
  2. Navigate to Administration > Configuration > Content authoring > DOCX to HTML Converter, or directly access it via the URL /docx-to-html. Note that the 'Access DOCX to HTML Converter' permission is required.
  3. Choose a Docx file from your local machine. The converted HTML preview will automatically display below, and a 'Copy the HTML' button will appear to copy the entire converted content with HTML styling into the clipboard.

Notes

  • CKEditor 5 has its own tag and attribute restrictions. Some HTML tags or attributes pasted into the editor might be filtered out (e.g., H1 tag, IMG tag). If this happens, check the editor and format settings.
  • When copying HTML codes and pasting them into a Drupal text field, ensure that the target text field and format can sanitise (escape) malicious HTML tags and attributes, such as the Script tag.

Credits

This module is powered by mammoth.js.

Drupal 10–11

Ask your assistant about Docx to HTML Convert tool

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
7
Tracked since
Jun 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.0.0 Stable 10–11 Jun 24, 2024
1.0.0-rc3 Pre-release 10–11 Jun 21, 2024
1.0.0-rc2 Pre-release 10–11 Jun 20, 2024
1.0.0-rc1 Pre-release 10–11 Jun 20, 2024
1.0.0-beta2 Pre-release 10–11 Jun 14, 2024
1.0.0-beta1 Pre-release 10–11 Jun 13, 2024
1.0.x-dev Dev 10–11 Jun 13, 2024