File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1313
1414def sanitize_vcml_content (vcml_content : str ) -> str :
1515 """
16- Sanitizes VCML content by removing all Image tags and their content.
16+ Sanitizes VCML content by removing only ImageData tags and their content.
1717
1818 Args:
1919 vcml_content (str): Raw VCML content as string.
2020
2121 Returns:
22- str: Sanitized VCML content with all Image tags removed.
22+ str: Sanitized VCML content with ImageData tags removed.
2323 """
24- # Remove all Image tags and their content using regex
25- # This pattern matches <Image ...> ... </Image > including nested content
24+ # Remove only ImageData tags and their content using regex
25+ # This pattern matches <ImageData ...> ... </ImageData > including nested content
2626 # The pattern handles multiline content and preserves the rest of the XML structure
2727 sanitized_content = re .sub (
28- r'<Image [^>]*>.*?</Image >' ,
28+ r'<ImageData [^>]*>.*?</ImageData >' ,
2929 '' ,
3030 vcml_content ,
3131 flags = re .DOTALL | re .MULTILINE
3232 )
3333
34- # Clean up any extra whitespace that might be left after removing images
34+ # Clean up any extra whitespace that might be left after removing ImageData
3535 sanitized_content = re .sub (r'\n\s*\n' , '\n ' , sanitized_content )
3636
37- logger .info ("VCML content sanitized: Image tags removed" )
37+ logger .info ("VCML content sanitized: ImageData tags removed" )
3838 return sanitized_content
3939
4040
You can’t perform that action at this time.
0 commit comments