Feature request
Forum topic: https://wordpress.org/support/topic/dealing-with-extra-opening-closing-main-code-tags-included-in-the-snippet/
When users paste code into a snippet, the editor should handle language wrapper tags that the selected snippet type already supplies.
Requested behaviour
- Detect and strip matching opening and closing wrapper tags when code is pasted, such as PHP, CSS, and JavaScript tags.
- Show an informative warning when pasted code appears to use a different language from the selected snippet type.
- Make the warning clear before save, so users understand why the snippet cannot be saved or run.
Acceptance criteria
- Pasting code with matching outer wrapper tags stores only the code body.
- Pasting code that appears to be for a different snippet language shows a visible, actionable warning.
- Existing valid code pastes are unchanged.
Related work
The request for a clear notice when a snippet action fails is also covered by #488.
Feature request
Forum topic: https://wordpress.org/support/topic/dealing-with-extra-opening-closing-main-code-tags-included-in-the-snippet/
When users paste code into a snippet, the editor should handle language wrapper tags that the selected snippet type already supplies.
Requested behaviour
Acceptance criteria
Related work
The request for a clear notice when a snippet action fails is also covered by #488.