falta borrar y busqueda por columnas

This commit is contained in:
2025-09-27 17:07:24 +02:00
parent 88b43847f0
commit 847249d2de
25 changed files with 669 additions and 62 deletions

View File

@ -0,0 +1,25 @@
package com.imprimelibros.erp.config;
import org.jsoup.Jsoup;
import org.jsoup.safety.Safelist;
import org.springframework.stereotype.Component;
@Component
public class Sanitizer {
// Sin HTML: todo a texto plano
public String plain(String input) {
if (input == null) return null;
String cleaned = Jsoup.clean(input, Safelist.none());
return cleaned.strip();
}
// HTML mínimo permitido (opcional)
public String minimalHtml(String input) {
if (input == null) return null;
Safelist wl = Safelist.basic(); // b, i, em, strong, a...
wl.addTags("ul","ol","li"); // añade lo que necesites
wl.addAttributes("a","rel","nofollow"); // endurece enlaces
return Jsoup.clean(input, wl);
}
}