Support text formatting information (bold, italic, links) or provide markdown output
@vinay-google đang làm issue này rồi.
Từ ngày 22/9/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Problem
Currently, Google Apps Script and Google Forms API do not provide access to text formatting information for any text fields in forms. This means that rich text formatting like bold, italic, underline, and links are lost when retrieving form data programmatically.
Current Behavior
When using FormApp.openById() to retrieve form data, all text fields return only plain text:
var form = FormApp.openById(formId);
// Form level
var title = form.getTitle(); // Plain text only
var description = form.getDescription(); // Plain text only
form.getItems().forEach(function(item) {
// Item level
var title = item.getTitle(); // Plain text only
var helpText = item.getHelpText(); // Plain text only
// Type-specific text fields
switch (item.getType()) {
case FormApp.ItemType.SECTION_HEADER:
var section = item.asSectionHeaderItem();
var sectionTitle = section.getTitle(); // Plain text only
var sectionDescription = section.getHelpText(); // Plain text only
break;
case FormApp.ItemType.TEXT:
case FormApp.ItemType.PARAGRAPH_TEXT:
var text = item.asTextItem();
var title = section.getTitle(); // Plain text only
var description = section.getHelpText(); // Plain text only
break;
.....
}
});
All formatting is stripped and only plain text is returned from:
- Form title and description
- Item titles and help text
- Section header titles and descriptions
- Choice values and labels
- Scale labels (upper/lower bound labels)
- Any other text content in forms
Expected Behavior
The API should provide markdown output for all text fields that support rich formatting:
var form = FormApp.openById(formId);
// Form level with markdown
var title = form.getTitle({ format: 'markdown' });
var description = form.getDescription({ format: 'markdown' });
form.getItems().forEach(function(item) {
// Item level with markdown
var title = item.getTitle({ format: 'markdown' });
var helpText = item.getHelpText({ format: 'markdown' });
switch (item.getType()) {
case FormApp.ItemType.SECTION_HEADER:
var section = item.asSectionHeaderItem();
var sectionTitle = section.getTitle({ format: 'markdown' });
var sectionDescription = section.getHelpText({ format: 'markdown' });
break;
case FormApp.ItemType.TEXT:
case FormApp.ItemType.PARAGRAPH_TEXT:
var text = item.asTextItem();
var title = section.getTitle({ format: 'markdown' });
var description = section.getHelpText({ format: 'markdown' });
break;
.....
}
});
Current API Response Example
Currently, the API returns plain text even when the original content has formatting:
{
"itemId": "42f47236",
"textItem": {},
"title": "Simple Text",
"description": "with Link Suneo"
}
Expected API Response with Markdown
With markdown support, the same content should return:
{
"itemId": "42f47236",
"textItem": {},
"title": "Simple Text",
"description": "with [Link Suneo](https://example.com)"
}
Use Cases
- Form Documentation: Generate accurate documentation that preserves all formatting across all form elements
- Custom Form Renderers: Display complete forms in external applications with proper formatting for all text elements
- Form Migration: Move forms between platforms while preserving text styling in titles, descriptions, choices, and help text
- Accessibility: Maintain semantic meaning of formatted text throughout the entire form
- Content Management: Export complete form content for editing in external systems
- Form Analysis: Analyze form content while preserving the visual hierarchy and emphasis
Impact
This limitation affects all text content in forms:
- Form Structure: Titles and descriptions lose formatting
- Navigation: Section headers and descriptions lose emphasis
- User Guidance: Help text and instructions lose important formatting
- Choices: Multiple choice and checkbox options lose formatting
- Scales: Rating scale labels lose formatting
- Content Hierarchy: Visual emphasis and structure is lost
Proposed Solution
Add an optional format parameter to all text retrieval methods:
// Form level
form.getTitle({ format: 'markdown' })
form.getDescription({ format: 'markdown' })
// Item level
item.getTitle({ format: 'markdown' })
item.getHelpText({ format: 'markdown' })
// Section headers
sectionHeaderItem.getTitle({ format: 'markdown' })
sectionHeaderItem.getHelpText({ format: 'markdown' })
// Scale labels
scaleItem.getLowerBoundLabel({ format: 'markdown' })
scaleItem.getUpperBoundLabel({ format: 'markdown' })
// Choice values
choice.getValue({ format: 'markdown' })
This would convert rich text formatting to markdown equivalents:
- Bold text →
**Bold text** - Italic text →
*Italic text* Strikethrough→~~Strikethrough~~- Link text →
[Link text](url) - Underlined text →
<u>Underlined text</u> - Lists →
- Itemor1. Item
Environment
- Google Apps Script
- Google Forms API
- FormApp service
Related
This issue addresses the comprehensive need for preserving text formatting across all form elements in the Google Forms API.
- Ngôn ngữ chính
- JavaScript
- Star
- 5.2k
- Fork
- 2k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của googleworkspace/apps-script-samples
-
Alvin Litana MirasolĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
googleworkspace/apps-script-samples#659 · 1 bình luận · 1 reaction ·
-
Password resetĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
googleworkspace/apps-script-samples#654 · 2 reaction ·
-
cod gsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
googleworkspace/apps-script-samples#651 · 1 reaction ·
-
tespogromeĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
googleworkspace/apps-script-samples#624 · 1 reaction ·
-
Get_order_manually.gsCó thể làm lại được @vinay-google đã nhận 243 ngày trước và không có pull request nào đang mở. Đang mở
googleworkspace/apps-script-samples#616 · 1 người được giao ·
Tất cả issue của googleworkspace/apps-script-samples
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
quarto-dev/quarto-cli#15042 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
extendr/extendr.github.io#134 ·
-
OpenCode install copies the Pi harness directory (`.pi/`) into the OpenCode config rootCó thể đã có người làm @gaurav0107 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Docs viewer: inverted grey colormap, Phantom CT window -20 to 35 HU, smoothing up to 40 mmCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea: docs enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
PyTomography/PyTomography#331 ·
Maintainer thường phản hồi trong vòng 1 ngày