Security Test Cases for Pill Label Shortcode
Normal Usage
HTML Injection Attempt
Invalid Class - Generates “Warning: Unsupported class” Message
Malicious Style Attempt - Generates “Warning: Potentially unsafe style attribute” Message
Additional Unsafe Style Test - Generates “Warning: Potentially unsafe style attribute” Message
Expression Style Test - Generates “Warning: Potentially unsafe style attribute” Message
Safe Complex Style Attempt
Warning Messages Generated During Build
The Hugo build log should show these warnings for the malicious test cases:-
For invalid class:
-
For unsafe style attributes:
IMPORTANT
This page is set todraft: true
to prevent it from being built in production,
avoiding warning messages in deployment logs. To test the security features:
- Run Hugo locally with the draft flag:
hugo serve -D
- Observe the warning messages in the terminal
- Verify the rendered output in the browser