testing
ffmad / htmltoopenxml Goto Github PK
View Code? Open in Web Editor NEWSimple PHP script which take HTML code and transform it into OpenXML Code. (for Docx)
Simple PHP script which take HTML code and transform it into OpenXML Code. (for Docx)
Hi,
Thank you for this interesting package.
I met a PHP error using fromHTML method of HTMLparser class.
Uninitialized string offset: 14
concerning the suppressStyle method of ProcessProperties class.
So, It could be interesting to create an exception in a first time (which could be catch). The HTML content which creates this error :
<p>Ta<span style="color: rgb(240, 102, 102);">ta</span></p>
Pythagus
Hi @ffmad,
As you have seen I've been doing a bit of work on the library (https://github.com/rkorebrits/HTMLtoOpenXML) as I needed the logic. Not sure if you have any use for the library yourself anymore, but in case you are bored and do want to spend some time on it:
The code doesn't parse nested lists properly. I improved the logic by Geoff so that it resets the counts per list and later added logic for 2 levels of lists, but it currently still breaks on 3 levels, like:
The logic needs to be altered a bit so that it recursively looks for nests and parses them, while keeping the proper indentation. I'll probably get to it sometime in the near future myself otherwise.
When creating a Word document, you also need manually edit the numbering.xml
and I want to add a few sample files and explanation to the project next time I work on it.
When I convert a <li>
, I get an unstyled list - no bullet or number.
Is there a way to style this? Either by adding styles to the HTML, or updating the conversion code?
It appears to assign the style:
</w:t></w:r><w:p startliste><w:r><w:t>
Which is later converted:
$output = preg_replace("/(<w:p startliste>)/mi", "</w:p><w:p><w:pPr><w:pStyle w:val='BulletStyle'/></w:pPr>", $output);
It isn't clear what BulletStyle is defined as.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.