Support text formatting information (bold, italic, links) or provide markdown output
@vinay-google がすでに取り組んでいます。
2025年9月22日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- JavaScript
- スター
- 5.2k
- フォーク
- 2k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleworkspace/apps-script-samples のほかの issue
-
Alvin Litana Mirasolオープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
googleworkspace/apps-script-samples#659 · コメント 1 件 · リアクション 1 件 ·
-
Password resetオープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
googleworkspace/apps-script-samples#654 · リアクション 2 件 ·
-
cod gsオープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
googleworkspace/apps-script-samples#651 · リアクション 1 件 ·
-
tespogromeオープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
googleworkspace/apps-script-samples#624 · リアクション 1 件 ·
-
Get_order_manually.gs再び着手できるかも @vinay-google が 227 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
googleworkspace/apps-script-samples#616 · 担当者 1 名 ·
googleworkspace/apps-script-samples の issue をすべて見る
似ている issue
-
bug CI breakage triage needed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
oppia/oppia#27517 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
draftomen enhancement size: S
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
andreagrandi/draftomen#761 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
HarperFast/harper#2866 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
HarperFast/harper-pro#927 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
anthropics/skills#1897 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信