New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exporting an a Tag with & character in the href the exported file is corrupted #94
Comments
This appears to be a noted issue with Nokogiri when there isn't a DOCTYPE (which MS Word docs lack) sparklemotion/nokogiri#961. I think the easy fix is simply gsubing the |
@stadelmanma : Even if we send the original HTML with Line 535 in 4a7b82a
|
@amrfaisal can you test this against #95? I think that should fix things since I gsub the ampersand out during creation of the tag which is after the line in ast.rb you flagged. I also dropped a line on the relevant Nokogiri issue but given that it's been around since 2013 I doubt things will change. |
@stadelmanma : Tested and working as expected, thanks a lot for the quick fix, please notify me when this pull request got merged. |
@amrfaisal there is an update sablon release on ruby gems, 0.2.1, with this fix. Thanks for your help testing! |
That was fast, tested the new release, and it's working as expected. Thanks a lot. |
When the href value of a Tag contains special characters like ampersand, the exported file is corrupted. After investigating I found out that the Relationship tag and its attributes get lowercased when added to the @relationships object.
for example:
html text = "https://www.google.com.eg/?gfe_rd=cr&dcr=0&ei=mSKcWqXgIIKZX9zomrAL"
exported xml node =
<relationship type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" target="https://www.google.com.eg/?gfe_rd=cr&dcr=0&ei=WAGcWsyWCbKZX-nZAg" targetmode="External" id="rId15">
expected exported xml node =
<Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="https://www.google.com.eg/?gfe_rd=cr&dcr=0&ei=WAGcWsyWCbKZX-nZAg" TargetMode="External" Id="rId15">
The text was updated successfully, but these errors were encountered: