Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration entry to allow adding additional elements. #36

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix policy not initialized after restart.
  • Loading branch information
lhupfeldt committed May 7, 2021
commit de234dd1b471915d040440f2647aa88dc5fd3f86
12 changes: 11 additions & 1 deletion src/main/java/hudson/markup/RawHtmlMarkupFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class RawHtmlMarkupFormatter extends MarkupFormatter {
final boolean disableSyntaxHighlighting;
final String additionalAllowed;
private final transient BasicPolicy policy;
private transient BasicPolicy policy;

@DataBoundConstructor
public RawHtmlMarkupFormatter(final boolean disableSyntaxHighlighting, final String additionalAllowed) {
Expand All @@ -34,6 +34,16 @@ public RawHtmlMarkupFormatter(final boolean disableSyntaxHighlighting, final Str
this.policy = new BasicPolicy(additionalAllowed);
}

/**
* Restores the configuration after deserialization.
*
* @return this instance
*/
protected Object readResolve() {
this.policy = new BasicPolicy(this.additionalAllowed);
return this;
}

public boolean isDisableSyntaxHighlighting() {
return disableSyntaxHighlighting;
}
Expand Down