···11+---
22+'@atcute/bluesky-richtext-builder': major
33+---
44+55+accept display text in addTag
+6-5
packages/bluesky/richtext-builder/README.md
···7373 .addText('hello ')
7474 .addMention('@bsky.app', 'did:plc:z72i7hdynmk6r22z27h6tvur')
7575 .addText('! ')
7676- .addTag('atproto');
7676+ .addTag('#atproto', 'atproto');
77777878await ok(
7979 rpc.post('com.atproto.repo.createRecord', {
···140140141141### adding hashtags
142142143143-hashtags are added without the `#` prefix - it's added automatically:
144144-145143```ts
146146-const rt = new RichtextBuilder().addText('loving ').addTag('atproto').addText(' development!');
144144+const rt = new RichtextBuilder()
145145+ .addText('loving ')
146146+ .addTag('#atproto', 'atproto')
147147+ .addText(' development!');
147148148149// text: "loving #atproto development!"
149150```
···168169there are multiple ways to get the composed rich text:
169170170171```ts
171171-const rt = new RichtextBuilder().addText('hello ').addTag('world');
172172+const rt = new RichtextBuilder().addText('hello ').addTag('#world', 'world');
172173173174// via getters
174175const text = rt.text;
+3-2
packages/bluesky/richtext-builder/lib/index.ts
···129129130130 /**
131131 * Add inline hashtag to the rich text
132132+ * @param text Text to display
132133 * @param tag The tag, without the pound prefix
133134 * @returns The builder instance, for chaining
134135 */
135135- addTag(tag: string): this {
136136- return this.addDecoratedText('#' + tag, { $type: 'app.bsky.richtext.facet#tag', tag: tag });
136136+ addTag(text: string, tag: string): this {
137137+ return this.addDecoratedText(text, { $type: 'app.bsky.richtext.facet#tag', tag: tag });
137138 }
138139}
139140