Giter Club home page Giter Club logo

mammoth-wordpress-plugin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mammoth-wordpress-plugin's Issues

Empty links being pulled through by importer

Not a bug so much as the importer working perfectly and Word being odd, but we're seeing some empty links (no href element) being pulled through. In the Word doc they take the form , and when they're imported the name element is converted to an ID element with the post number added to the value as a prefix.

Would it be feasible to add an option to not import links that don't have an href value? We've struggled to identify why these links are being placed in Word in the first place, and it doesn't seem to be straightforward to delete them from a document once they're there.

Custom post types support

Hi there,

I hope this email finds you well. In regards to your question, I wanted to confirm whether or not the plugin we offer supports custom post types with your awesome plugin.

If you could kindly provide me with more details, I would be happy to look into this for you and get back to you as soon as possible.

Thank you for your time and I look forward to hearing from you soon.

Best regards,

Mihály

Numbered lists are not properly converted

Example .docx content with numbered list:

1) item 1
some text
some text
2) item 2
3) item 3
some text
4) item 4

Converted into:

1. item 1
some text
some text
1. item 2
1. item 3
some text
1. item 4

WordPress 4.9.2
PHP 7.0.25

Problems with default image filename (long import time)

Hi
As I've faced a lot of problems with image upload time, which is getting longer and longer together with the number of images in Media Library, I made an investigation. As I have found out, based on plugin code Wordpress is creating file word-image.png. But that is only for the first time. The second image filename is word-image-1.png. Problem appears when we have a lot of images called word-image-{$incremented_number}, because plugin by default wants to create image word-image.png, but let's say, that this name already exists in Library, so wordpress is incrementing filename, and check if word-image-1.png exists, if no, then ok. If yes, WP check next one, and the next one. In case we have images called from word-image.png to word-image-1000.png, a thousand of ajax request is being carried out to find the first free filename with above pattern. My solution for this problem is very simple. I wrote simple function to generate 9 digit filename, and the problem has gone.

Cannot update to v1.4

I just tried to do the standard wordpress update for this great plugin but it failed due to "probable incompatible permissions" - this didn't happen with the previous version or with other plugins that I updated at the same time - unfortunately I don't seem to be able to get any further information on exactly which permissions may have been wrong and as far as I know they are all standard. Any idea why this update may have caused this to happen?

Where do I place the custom mappings?

Hello Michael,

Thanks for responding to my email. I am using the WordPress plugin to import license docs to a WordPress site. Because stying is critical to these items I need to use some custom mapping. I get the following error using default settings:
Heading EULA.docx

Warning: Unrecognised paragraph style: 'Heading EULA' (Style ID: HeadingEULA)
Warning: Unrecognised paragraph style: 'Heading Software Title' (Style ID: HeadingSoftwareTitle)
Warning: Unrecognised run style: 'Preamble' (Style ID: Preamble)
Warning: Unrecognised paragraph style: 'Compliance Border Above' (Style ID: ComplianceBorderAbove)
Warning: Unrecognised paragraph style: 'List Style 4' (Style ID: ListStyle4)
Warning: Unrecognised paragraph style: 'List Style 5' (Style ID: ListStyle5)
Warning: Unrecognised paragraph style: 'List Style 2' (Style ID: ListStyle2)
Warning: Unrecognised paragraph style: 'List Style 3' (Style ID: ListStyle3)

I would like to add the following custom mappings to the plugin so anyone using the converter gets the correct styles (with help from CSS).

p[style-name='Heading EULA'] => h1.headingeula:fresh
p[style-name='Heading Software Title'] => h1.headingsoftwaretitle:fresh
p[style-name='Preamble'] =>
p[style-name='Compliance Border Above'] =>
p[style-name='List Style 4'] => ul.liststyle4 > li
p[style-name='List Style 5'] => ul.liststyle5 > li
p[style-name='List Style 2’] => ol.liststyle2 > li
p[style-name='List Style 3’] => ol.liststyle3 > li

I must be missing something but I see how to style the mappings but not where to place them in the plugin.

  • Pierre

Space characters on new lines breaking <pre> blocks

The HTML conversion inserts 2 space characters as a tab on each new line, which is great for legibility, but in code blocks it's breaking Python code when you copy it out. Would it be possibly to (perhaps optionally) switch this off when it's in code, so additional spaces aren't displayed in the rendered <pre>?

Sorry.

Also: hi!

Links are splitted if special charaters

Hello,

When .doc file has special character in link, ie: comunicación, then the parser split it in several parts. The link seems to be well and actually works, but code is quite obfuscated.

In this example result code will be similar to this:
<a href="https://es.wikipedia.org/wiki/Comunicación">comunicaci</a><a href="https://es.wikipedia.org/wiki/Comunicación">ó</a><a href="https://es.wikipedia.org/wiki/Comunicación">n</a>

Is not crucial but I think is important that code is as clean as possible.

thanks in advance

Problem with custom style map change heading line 1 to h2

Hi there!
First, amazing work. I have installed the plugin on my website. But I encountered a problem when using options-plugin.
I want change heading1 to h2 by using custom style map. But it didn't work.
my mammoth-options.js is below

function MAMMOTH_OPTIONS(mammoth) { var styleMap = [ "p[style-name^='Heading'] => h2:fresh", "p[style-name='Heading 1'] => h2:fresh", "p[style-name^='1'] => h2", "p[style-name='标题1'] => h2:fresh", "p[style-name='标题2'] => h3:fresh", ]; console.log('styleMap load!-7'); }

And the docx file is attached.
demo-en.docx

Can you figure out what problem is?

Formatting Issue WordPress 5.6

I noticed a issue with formatting when importing word documents in WordPress 5.6.

When i initially go to import word documents the preview that i am presented with looks correct. When I preview the post as a whole after mammoth coverts the word document to HTML I notice that none of the underlying HTML that I saw in the HTML view is present out side of

  • and associated tags.

    There is a work around for this that I found but I still wanted to bring what i presume is a bug to your attention.

    After importing the word document I was presented with the option Covert to Blocks in the wordpress visual editor. After converting the imported HTML to Blocks the formatting seemed to be retained form the word document that was originally lost if I did not do that.

  • Style applied / interpreted on each character instead of word

    Hello,
    I have the strange phenomenon that every now and then, for a word, the styling is interpreted internally per letter.
    Even if I reset the styling to "default / standard" and reformat the word, this error remains.
    Only when I completely rewrite the word and reassign the style, it then works again.
    Of course, you can't be held responsible for the bugs in Word, so just a suggestion on how to solve this problem anyway.
    So my idea is:
    If letters with identical, consecutive styles appear, interpret these letters as one word with only one style.

    Would this perhaps be possible and could it work or is there another work-around? Thanks a lot!

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.