Comments (5)
Hi @maggielei
Thanks for reaching out. Sablon is not specifically supporting Hyperlinks at this time so it's definitely possible that this is not working as expected. You could work on a patch to add this functionality to Sablon.
@stadelmanma did you have any plans to do links on HTML insertion? Or is your project in need to use Sablon templates with Hyperlinks?
from sablon.
@maggielei @senny
Currently our workflow doesn't involve hyperlinks at all so I didn't plan on adding support for an <a>
tag.
Reading that stack overflow answer made it seem like native mail merge support was shaky at best.
I saved a test document and unzipped it to see how MS Word handled hyperlinks and it looks like an HTML insertion would be the best way. You would use the href
attribute to set the target in document.xml.rels and the actual content between the <a>...</a>
to set up the w:hyperlink
node in document.xml. However, the bigger issue is that currently HTML insertion replaces the entire paragraph which would be less than desirable in this case.
I don't know how hard it would be to allow "inline" elements <a>, <b>, <span>
, etc. to replace an individual run instead.
from sablon.
@senny @stadelmanma
Thank you both for your quick responses! I'll be subscribing to #47 for more updates and in the meantime I'll try to see if I can come up with my own solution. Thanks again.
from sablon.
@maggielei hyperlink creation is now possible on the master branch via HTML content insertion. However, it currently comes with the limitation that the entire paragraph must be replaced. Inline HTML/WordML insertion is something I am working on now.
from sablon.
@maggielei See here for a method to insert HTML hyperlinks into a document without replacing the entire paragraph.
from sablon.
Related Issues (20)
- Can i access a specific item in an array? HOT 2
- Dynamic Table Columns HOT 3
- Adding table to html creates corrupted file HOT 3
- template members get automatically stripped HOT 3
- image: "auto" property to keep aspect ratio HOT 2
- HTML Table got inserted without width HOT 1
- Conditionals: allow string comparism HOT 4
- Remove empty pages on the generated docx HOT 4
- Issue with inserting a Hyperlink via HTML content. HOT 2
- Table header: repeat on subsequent pages HOT 1
- Use mail merge fields in LibreOffice Writer HOT 1
- nested tables support? HOT 5
- Insert new mail merge fields using sablon HOT 2
- How to iterate over values of a hash? HOT 1
- Insert Templates into one another HOT 2
- Is it possible to specify the Word "Table Style" with an HTML <table>?
- Re-using content with images on multiple renders HOT 5
- p is not a valid child element of div HOT 4
- Injecting text-align: justify into docx file
- Unicode control characters in inputs may break generation of documents HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sablon.