ampproject / ampproject/amphtml

[href] found my plain text is not a valid result

Open
#38,541 1 comment 0 reactions 0 assignees View on GitHub
P3: When Possible Type: Bug WG: components
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

I want to be able to download the transcript from a BrightCove video. I am able to retrieve the transcript by using amp-script. I tried to pass the AMP.setState transcriptContent from amp-script to < a > tag with [href]. However, it seems not to be able to accept my request and indicates it is not valid.

https://s3-componentsexperiments-sbx01-cac1-01.s3.ca-central-1.amazonaws.com/AMP/donotdelete/video-transcript.html

![image](https://user-images.githubusercontent.com/60678229/201206862-58df3e13-ea3b-4d8a-b3df-10877fd85e9c.png)
![image](https://user-images.githubusercontent.com/60678229/201207120-43cd4c75-ecb8-4def-99ef-9d8488583b10.png)

### Reproduction Steps

The error appears in the console

### Relevant Logs

```shell
error-reporting.js:201
https://s3-componentsexperiments-sbx01-cac1-01.s3.ca-central-1.amazonaws.com/AMP/donotdelete/video-transcript.html:
Expression evaluation error in "%s". %s amp-bind transcriptContent "data:text/plain;charset=utf-8,Hello%20World" is not a valid result for [href].
```

### Browser(s) Affected

Chrome

### OS(s) Affected

_No response_

### Device(s) Affected

_No response_

### AMP Version Affected

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.