![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
github.com/nickwarters/goldmark-highlighting/v2
goldmark-highlighting is an extension for the goldmark that adds syntax-highlighting to the fenced code blocks.
goldmark-highlighting uses chroma as a syntax highlighter.
go get github.com/yuin/goldmark-highlighting/v2
package main
import (
"bytes"
"fmt"
"github.com/yuin/goldmark"
chromahtml "github.com/alecthomas/chroma/v2/formatters/html"
highlighting "github.com/yuin/goldmark-highlighting/v2"
)
func main() {
mdsrc := `
Title
=======
` + "```" + `
func main() {
fmt.Println("ok")
}
` + "```" + `
`
// Simple usage
markdown := goldmark.New(
goldmark.WithExtensions(
highlighting.Highlighting,
),
)
var buf bytes.Buffer
if err := markdown.Convert([]byte(mdsrc), &buf); err != nil {
panic(err)
}
title := buf.String()
fmt.Print(title)
// Custom configuration
markdown2 := goldmark.New(
goldmark.WithExtensions(
highlighting.NewHighlighting(
highlighting.WithStyle("monokai"),
highlighting.WithFormatOptions(
chromahtml.WithLineNumbers(true),
),
),
),
)
var buf2 bytes.Buffer
if err := markdown2.Convert([]byte(mdsrc), &buf2); err != nil {
panic(err)
}
title2 := buf2.String()
fmt.Print(title2)
}
MIT
Yusuke Inuzuka
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.