Bug 36328: Add a separate 'note' profile

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-03-20 08:34:09 +01:00 committed by Katrin Fischer
parent b6f0c7026a
commit 920784ce06
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
2 changed files with 4 additions and 2 deletions

View file

@ -29,7 +29,8 @@ use C4::Context;
my %scrubbertypes = (
default => {}, # place holder, default settings are below as fallbacks in call to constructor
tag => {}, # uses defaults
comment => { allow => [qw[ p b i u hr br em big small strong span div ]] },
comment => { allow => [qw( br b i em big small strong )], },
note => { allow => [qw[ p b i u hr br em big small strong span div ]] },
staff => {
default => [ 1 => { '*' => 1 } ],
comment => 1,
@ -49,6 +50,7 @@ sub new {
rules => exists $settings->{rules} ? $settings->{rules} : [],
default => exists $settings->{default} ? $settings->{default} : [ 0 => { '*' => 0 } ],
comment => exists $settings->{comment} ? $settings->{comment} : 0,
note => exists $settings->{note} ? $settings->{note} : 0,
process => 0,
);
return $scrubber;

View file

@ -82,4 +82,4 @@ if ($@) {
pass("Test should have failed on entry of 'Client' and it did. YAY!");
}
is( C4::Scrubber->new('comment')->scrub('<span>Allow span</span>'), '<span>Allow span</span>' );
is( C4::Scrubber->new('note')->scrub('<span>Allow span</span>'), '<span>Allow span</span>' );