Пример #1
0
        private string StartImageHandler(string[] startTagComponents)
        {
            if (startTagComponents.Length == 2)
            {
                if (startTagComponents[0].Equals(ImageNoChmAttribute))
                {
                    if (_topicCompilerSettings.ChmCreationMode)
                    {
                        return("");
                    }
                }

                else
                {
                    throw new Exception(String.Format("Unknown image tags {0} / {1}", startTagComponents[0], startTagComponents[1]));
                }
            }

            Preprocessor.ImagePreprocessor image = _helpComponents.preprocessor.GetImage(startTagComponents[startTagComponents.Length - 1]);

            // for accessibility, set the title to the name of the image, replacing underscores with spaces
            string imageTitle = Path.GetFileNameWithoutExtension(image.Filename).Replace('_', ' ');

            return(String.Format("<img src=\"{0}\" title=\"{1}\"/>", _topicCompilerSettings.GetHtmlFilename(image), imageTitle));
        }