How to have syntax highlighter when I copy a code from meta editor to my personal blog

 

Hello everyone, My code in meta editor looks like this:

and when I paste it in here looks like this:

//+------------------------------------------------------------------+

//|                                           Dragging Handle EA.mq5 |

//|                                      Copyright 2022-2025, TradeX |

//|            https://www.mql5.com/en/users/alireza.saeedian/seller |

//+------------------------------------------------------------------+

#property copyright "Copyright 2022-2025, TradeX"

#property link      "https://www.mql5.com/en/users/alireza.saeedian/seller"

#property version   "1.01"

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

#include "CDragHandle.mqh"

CDragHandle drag;


//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

int value_2 = (int)ChartGetInteger(ChartID(), CHART_SCALE, 0);

How can I have them with different colors with just copying and pasting. I am writing an article and I can't have them in highlighted syntax. I see that other authors articles is showing the code in different colors like this:


 

Use  Code button:


 
Marsel #:

Use  Code button:


Can you please help me to make a table of contents too?
I checked links and anchors page when I want to write an article but I couldn't find out.

 
Mehdi Ghorbani Saeidian #:

Can you please help me to make a table of contents too?
I checked links and anchors page when I want to write an article but I couldn't find out.

Fix code listings first. Remove empty lines.