Feature request: Better code formatting on forum


I have a hard time putting code formatted in a post.

When I post xml it gets swallowed and javascript doesn’t get formatted right.

Can we get better support for that plz?

<ScrollView class="green">
<WrapLayout horizontalAlignment="center">      
    <StackLayout style="margin-left: 10" class="card" width="45%" *ngFor="let recipe of (recipes$ | async)">
        <StackLayout horizontalAlignment="center" (tap)="goToRecipe(recipe.id)">
            <Image [src]="recipe.Image"></Image>            
            <Label class="name" horizontalAlignment="center" textWrap="true" [text]="recipe.Name"></Label>


I use the little </> code formatter, are you doing something different?

import { Component, OnInit } from "@angular/core";
import { Observable } from "rxjs/Observable";
import { RecipesService } from "../services/recipes.service";
import { Router, ActivatedRoute } from "@angular/router";

    selector: "recipes",
    moduleId: module.id,
    templateUrl: "./recipes.component.html",
export class RecipesComponent implements OnInit {
  public recipes$: Observable<any>;
  private sub: any;
  category: string;
  title: string;
    constructor(private recipeService: RecipesService,
                private activatedRoute: ActivatedRoute,
                private router: Router) 
                { }

    ngOnInit(): void {
        this.sub = this.activatedRoute.params.subscribe((params: any) => {
            this.category = params['category'];
                this.recipes$ = <any>this.recipeService.getRecipes(this.category);
                switch (this.category)
                case "meat":
                    this.title = "Meat Recipes";
                case "soupssalads":
                    this.title = "Soup and Salad Recipes";
                case "snacks":
                    this.title = "Snack Recipes";
                case "desserts":
                    this.title = "Dessert Recipes";
                case "vegetarian":
                    this.title = "Vegetarian Recipes";
                case "everythingelse":
                    this.title = "Everything Else";
                case "all":
                    this.title = "All Recipes";
                default : "Recipes";

     goToRecipe(id: string){
        this.router.navigate(["/recipe", id]);


hah, I’ve set the code to use ‘code fences’ instead of indents, I think this is better


@StudderVOF general markdown should work also. It’s what I use on here.

For xml - three backticks to open the codeblock followed by the text xml and then paste your code, next line close with three backticks


Hello all thanksyou so much make me already join here