feat: disable max length truncation for tags column in HTML
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -200,13 +200,12 @@ fn build_item_list(conn: &Connection, params: &ListQueryParams, columns: &[Colum
|
||||
}
|
||||
};
|
||||
|
||||
// Apply max_len if specified
|
||||
let display_value = if let Some(max_len_str) = &column.max_len {
|
||||
// Apply max_len if specified, but skip for tags column to avoid truncating HTML
|
||||
let display_value = if column.name == "tags" {
|
||||
value
|
||||
} else if let Some(max_len_str) = &column.max_len {
|
||||
if let Ok(max_len) = max_len_str.parse::<usize>() {
|
||||
if value.chars().count() > max_len {
|
||||
// Note: This might truncate HTML, which isn't ideal
|
||||
// For simplicity, we'll just truncate the text content
|
||||
// A better approach would be to strip HTML tags first, but that's more complex
|
||||
let truncated: String = value.chars().take(max_len).collect();
|
||||
format!("{}...", truncated)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user