Excel export: added a special case to add HYPERLINK Formula when text…#352
Excel export: added a special case to add HYPERLINK Formula when text…#352mdsimpson wants to merge 3 commits intobox:masterfrom
Conversation
… in the cell matches =HYPERLINK("link","name")
|
Hi @mdsimpson, thanks for the pull request. Before we can merge it, we need you to sign our Contributor License Agreement. You can do so electronically here: http://opensource.box.com/cla Once you have signed, just add a comment to this pull request saying, "CLA signed". Thanks! |
adrilo
left a comment
There was a problem hiding this comment.
Thanks for the pull request @mdsimpson !
I'm not a big fan of one-off changes like this one. It's definitely interesting to add formulas support to Spout but it needs to be thought as a whole, not just in the scope of hyperlinks.
| if ($this->shouldUseInlineStrings) { | ||
| $cellXML .= ' t="inlineStr"><is><t>' . $this->stringsEscaper->escape($cellValue) . '</t></is></c>'; | ||
| $matches = array(); | ||
| if (preg_match('/=HYPERLINK\("(.*)","(.*)"\)/', $cellValue, $matches)) { |
There was a problem hiding this comment.
This regex should be changed to support other ways of writing the formula: /=HYPERLINK\([\'"](.*)[\'"],\s*[\'"](.*)[\'"]\)/. This support single and double quotes as well as any number of spaces after the comma (it may also need the same \s before the comma)
… in the cell matches =HYPERLINK("link","name")
|
@mdsimpson, The entire row is colored except the hyperlink column. |
|
My pull request here: Appears to achieve this. |
Adaptation of a previous version PR box#352
|
Outdated PR |
… in the cell matches =HYPERLINK("link","name")
A very basic start at adding support for Excel function.