Giter Club home page Giter Club logo

Comments (8)

0xPr0xy avatar 0xPr0xy commented on May 12, 2024

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.

0xTim avatar 0xTim commented on May 12, 2024

@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.

0xTim avatar 0xTim commented on May 12, 2024

😂 Github is formatting my code for me!

from steampress.

0xTim avatar 0xTim commented on May 12, 2024
```swift
func getGreeting() -> String {
	return "Hello, World!"
}
```

and

```html
<h1>Hello World</h1>
```

from steampress.

0xTim avatar 0xTim commented on May 12, 2024

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.

0xPr0xy avatar 0xPr0xy commented on May 12, 2024

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.

0xPr0xy avatar 0xPr0xy commented on May 12, 2024

Oh is it now just ‘’’swift I used ~~~language-swift?

from steampress.

0xTim avatar 0xTim commented on May 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.