示例#1
0
func handleAidText(ctx context.Context, input []byte, m richcontent.MatchIndices) (string, error) {
	req, ok := ctx.Value(CtxKeyArticleRequest).(*ArticleRequest)
	if !ok {
		log.Println("no ArticleRequest present")
		return "", nil // Silently fail
	}

	aidString := string(m.ByteSliceOf(input, 1))
	return aidAndBrdnameToArticle(req.Brd.BrdName, aidString)
}
示例#2
0
func handleBoardAidText(ctx context.Context, input []byte, m richcontent.MatchIndices) (string, error) {
	brdname := string(m.ByteSliceOf(input, 1))
	aidString := string(m.ByteSliceOf(input, 2))
	return aidAndBrdnameToArticle(brdname, aidString)
}