Dear Eli,

You are right. The m17n libraries are outdated. I updated them and recompiled Emacs 25.3 but the problem persisted.
Due to time constraints, I am not looking forward to debugging this issue further. 
I will continue working with  Emacs 24.5.1 for now. 
Hopefully when I upgrade to Ubuntu 18.04, I will get new m17n libraries with Emacs 25.x and this issue won't show up.

​Thanks
,
Aviral


On Thu, Jan 4, 2018 at 11:06 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Aviral Goel <goel.aviral@gmail.com>
> Date: Wed, 3 Jan 2018 22:16:29 -0500
>
> On pressing  hve  in devanagari-itrans input method the following should be rendered - ह्वे
> But Emacs-25.3 (built from source) does not render this correctly. It splits the ` mark and places at the end of
> line.
> Similar behavior is observed on pressing d which should render द् but it does not.

I cannot reproduce this.  I'm not on Ubuntu, so this probably means
your m17n libraries are either outdated, or they have a bug.

> I have attached an image to show the problem. This however works fine on Emacs 24 (installed via package
> manager - apt)

Maybe Emacs 24 was built against different versions of the libraries
that participate in shaping complex scripts?