The Sinhala Text is wrong.
The Virama should ligate with Ma.
Also, when Pali is written in Sinhala, special conjuncts are used used. i.e in Dhamma - both ma ma touch each other to show they are a single consonant cluster.
Though, the Virama forms are acceptable.
The Brahmi Text is also wrong..
It must have a small ma below the Big ma
Buddhists Texts in Brahmi Script : http://www.virtualvinodh.com/brahmi-lipitva
yo dharmaṁ paśyati, sa buddhaṁ paśyati
One who sees the Dharma, sees the Buddha
na pudgalo na ca skandhā buddho jñānamanāsravam
sadāśāntiṁ vibhāvitvā gacchāmi śaraṇaṁ hyaham
Neither a person nor the aggregates, the Buddha, is knowledge free from [evil] outflows
Clearly perceiving [him] to be eternally serene, I go for refuge [in him]