Skip to content

Applying style to a raw value #142

Description

@merkiw

Is there a way to apply a style (e.g. make the text bold) on a raw value (e.g. of a script)?

use Shuchkin\SimpleXLSXGen;

$rows = [
    // prints the whole string correctly
    [SimpleXLSXGen::raw('<a href="#">some link</a>')], 

    // prints the whole string correctly
    [SimpleXLSXGen::raw('<b><a href="#">some link</a></b>')], 

    // prints a bolded hyperlink 'some link' instead of a bolded raw string "<a href="#">some link</a>"
    ['<b>' . SimpleXLSXGen::raw('<a href="#">some link</a>'). '</b>'], 
];

SimpleXLSXGen::fromArray($rows)
    ->downloadAs('test_raw.xlsx');

This prints out these values:
image

I'm trying to make the 3rd row value to look like this:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions