Comments (8)
Update: I found out that with the following markdown notation It seems to work in browser
~~~.language-swift
func getGreeting() -> String {
return "Hello, World!"
}
~~~
But this makes the WYSIWYG editor display the code striked through.
Also, still curious how I could get HTML to work since it is trusted input, so raw html does not need to be escaped here.
from steampress.
@0xPr0xy if you are trying to enter HTML in a post you want to use Markdown code blocks (see code blocks), so for Swift it would be
func getGreeting() -> String {
return "Hello, World!"
}
For HTML you want to do
<h1>Hello World!</h1>
Does that do what you were looking for?
from steampress.
😂 Github is formatting my code for me!
from steampress.
```swift func getGreeting() -> String { return "Hello, World!" } ```
and
```html <h1>Hello World</h1> ```
from steampress.
Or are you trying to write HTML in your posts that will be rendered as HTML when published or write HTML code in your posts that won't get rendered?
from steampress.
I was trying to use the HTML notation of prism to highlight the swift code, so in essence I was trying to render that html tags to highlight the swift code, markdown works fine though, html rendering is limited I guess
from steampress.
Oh is it now just ‘’’swift I used ~~~language-swift?
from steampress.
Ah yeah use ```swift
(three back ticks) to start and end code blocks and it will generate <pre><code class="swift">...</code></pre>
which any code highlighting library will work with
from steampress.
Related Issues (10)
- tags posts is null HOT 7
- user is not login HOT 9
- Title can not chinese HOT 4
- Logo
- LeafMarkdown link returns 404 error HOT 1
- Continue Reading link does not work from search result on partial match HOT 2
- Not log default admin password when preparation. HOT 1
- Vapor has been upgraded to 3.0 HOT 9
- Server error: dispatch(HTTP.ParserError.invalidStartLine) HOT 9
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 steampress.