Comments (7)
Again it would be great if you could provide more details. In this particular case about the current output and the expected output.
Although to keep things short, I guess you want to do something like this:
const body = render(
`# Hello, world!
<ul style="list-style-type: '🔔 ';">
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
- Normal list
- Normal list
- Normal list
`,
{ allowedAttributes: { ul: ["style"] } },
);
from deno-gfm.
Please close this if using allowedAttributes
solves your problem.
from deno-gfm.
It looks promising, but not working on my machine. The full code:
import { render } from "https://deno.land/x/gfm/mod.ts";
const body = render(
`# Hello, world!
<ul style="list-style-type: '🔔 ';">
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
- Normal list
- Normal list
- Normal list
`,
{ allowedAttributes: { ul: ["style"] } },
);
export default function a() {
return <main dangerouslySetInnerHTML={{ __html: body }}>
{body}
</main>
}
There is an error at allowedAttributes
: Object literal may only specify known properties, and 'allowedAttributes' does not exist in type 'RenderOptions'.deno-ts(2353)
from deno-gfm.
It's always a good idea to be explicit about versions. You likely have an old version cached. Try specifying the version like this: https://deno.land/x/[email protected]/mod.ts
from deno-gfm.
I see. I thought that if you don't specify the version, the runtime will check if the cache is already in the latest version or not. I also notice that the allowedAttributes
option is only introduced at 0.6.0. However the release note doesn't note this. Is this normal?
from deno-gfm.
Blindly using the latest version can be, at worst, a huge security vulnerability and, slightly less bad, can sometimes cause your code to break. I can't really imagine a case where always using the latest is desired.
As for the caching issue, I guess if you had reran your code with -r
it would have reloaded the dependencies.
For the release notes, most projects just take a list of all the PRs that have been merged. You can see I'm there:
feat: custom tags and attributes by @deer in #95
What more are you expecting?
from deno-gfm.
I see. Thanks for your help
from deno-gfm.
Related Issues (20)
- All left angle brackets are HTML encoded? HOT 3
- How to embed image? HOT 3
- Allow task lists HOT 1
- Allow alert/callout HOT 1
- strip: extract alt from images
- strip: properly remove math in all scenarios
- strip: handle footnotes
- Write actual docs
- katex types seemingly not cacheable HOT 2
- yaml parsing does not work
- title="null" with disableHtmlSanitization: true
- `render`(`mathify`) throws `ParseError` while rendering README.md of deno_mongo
- Rendering bug with dollar signs in tables HOT 1
- HTML appears in code HOT 2
- Dependency Deprecation Warning HOT 1
- Support "Note" and "Warning" highlight like GitHub HOT 2
- Remove marked-mangle as it doesn't work HOT 1
- Dependency deprecation warning for `baseUrl` HOT 2
- Add an option for hard line breaks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno-gfm.