Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
S
sshoc-marketplace-backend
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4
    • Issues 4
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • SSHOC
  • sshoc-marketplace-backend
  • Issues
  • #12

Closed
Open
Opened Dec 21, 2019 by serviceAcc.5d4bd64a607a0@stefan.probstMaintainer

handle creating items with markdown in description field

when creating a new item, html tags in the description field are transformed into markdown. however, this incorrectly strips line breaks and wrongly escapes characters in md content.

example:

this works correctly (line breaks and fenced code block are preserved):

curl http://localhost:8080/api/tools \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"label":"Test Tool","description":"# Heading\n\nSome **bold** text.\n\n```js\nfunction hello() {}\n```\n"}'

resulting description:

"# Heading\n\nSome **bold** text.\n\n```js\nfunction hello() {}\n```\n"

this however fails (note: **bold** => <strong>bold</strong>):

curl http://localhost:8080/api/tools \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"label":"Test Tool 2","description":"# Heading\n\nSome <strong>bold</strong> text.\n\n```js\nfunction hello() {}\n```\n"}'

resulting description:

"# Heading Some **bold** text. \\`\\`\\`js function hello() {} \\`\\`\\`"
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: sshoc/sshoc-marketplace-backend#12