Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -177,8 +177,8 @@ class CommentService(
|
||||
* Extracts plain text from TipTap/ProseMirror JSON content.
|
||||
* TipTap stores content as JSON like: {"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Hello"}]}]}
|
||||
*/
|
||||
private fun extractPlainTextFromTipTap(jsonContent: String): String {
|
||||
return try {
|
||||
private fun extractPlainTextFromTipTap(jsonContent: String): String =
|
||||
try {
|
||||
val rootNode = objectMapper.readTree(jsonContent)
|
||||
val textBuilder = StringBuilder()
|
||||
extractTextRecursively(rootNode, textBuilder)
|
||||
@@ -187,7 +187,6 @@ class CommentService(
|
||||
// If parsing fails, return the original content (might be plain text)
|
||||
jsonContent
|
||||
}
|
||||
}
|
||||
|
||||
private fun extractTextRecursively(
|
||||
node: JsonNode,
|
||||
@@ -203,7 +202,10 @@ class CommentService(
|
||||
content.forEachIndexed { index, child ->
|
||||
extractTextRecursively(child, builder)
|
||||
// Add newline between paragraphs
|
||||
if (child.has("type") && child.get("type").asText() == "paragraph" && index < content.size() - 1) {
|
||||
if (child.has("type") &&
|
||||
child.get("type").asText() == "paragraph" &&
|
||||
index < content.size() - 1
|
||||
) {
|
||||
builder.append("\n")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ spring:
|
||||
database-platform: org.hibernate.dialect.PostgreSQLDialect
|
||||
hibernate:
|
||||
ddl-auto: create
|
||||
show-sql: false
|
||||
show-sql: true
|
||||
properties:
|
||||
hibernate:
|
||||
format_sql: true
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
create table app_user
|
||||
(
|
||||
email_on_comment_added boolean not null,
|
||||
email_on_form_created boolean not null,
|
||||
email_on_form_submitted boolean not null,
|
||||
email_on_form_updated boolean not null,
|
||||
created_at timestamp(6) with time zone not null,
|
||||
modified_at timestamp(6) with time zone not null,
|
||||
email varchar(255),
|
||||
@@ -123,6 +125,7 @@ create table notification
|
||||
created_at timestamp(6) with time zone not null,
|
||||
id uuid not null,
|
||||
click_target varchar(255) not null,
|
||||
excluded_user_id varchar(255),
|
||||
message TEXT not null,
|
||||
organization_id varchar(255) not null,
|
||||
recipient_id varchar(255),
|
||||
|
||||
Reference in New Issue
Block a user