Process processes the given image data
(o *options.Options, data imagedata.ImageData)
| 32 | |
| 33 | // Process processes the given image data |
| 34 | func (p *Processor) Process(o *options.Options, data imagedata.ImageData) (imagedata.ImageData, error) { |
| 35 | if data.Format() != imagetype.SVG { |
| 36 | return data, nil |
| 37 | } |
| 38 | |
| 39 | var err error |
| 40 | |
| 41 | data, err = p.sanitize(data) |
| 42 | if err != nil { |
| 43 | return data, err |
| 44 | } |
| 45 | |
| 46 | return data, nil |
| 47 | } |
| 48 | |
| 49 | // sanitize sanitizes the SVG data. |
| 50 | // It strips <script> and unsafe attributes (on* events). |